1 ########################################################################
3 # Copyright (c) 2009, Secure Endpoints Inc.
6 # Redistribution and use in source and binary forms, with or without
7 # modification, are permitted provided that the following conditions
10 # - Redistributions of source code must retain the above copyright
11 # notice, this list of conditions and the following disclaimer.
13 # - Redistributions in binary form must reproduce the above copyright
14 # notice, this list of conditions and the following disclaimer in
15 # the documentation and/or other materials provided with the
18 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21 # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22 # COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
23 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
24 # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26 # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
28 # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 # POSSIBILITY OF SUCH DAMAGE.
34 !include ../../windows/NTMakefile.w32
36 gen_files_hdb = $(OBJ)\asn1_hdb_asn1.x
38 $(gen_files_hdb) $(OBJ)\hdb_asn1.hx $(OBJ)\hdb_asn1-priv.hx: $(BINDIR)\asn1_compile.exe hdb.asn1
40 $(BINDIR)\asn1_compile.exe --sequence=HDB-Ext-Keyset --sequence=Keys --one-code-file $(SRCDIR)\hdb.asn1 hdb_asn1
43 $(gen_files_hdb:.x=.c): $$(@R).x
45 !ifdef OPENLDAP_MODULE
47 ldap_dll = $(BINDIR)\hdb_ldap.dll
48 ldap_lib = $(LIBDIR)\hdb_ldap.lib
49 ldap_objs = $(OBJ)\hdb-ldap.obj
51 $(ldap_dll): $(ldap_objs)
52 $(DLLGUILINK) -implib:$(ldap_lib)
61 ldap = $(OBJ)\hdb-ldap.obj
66 dist_libhdb_la_SOURCES = \
91 $(OBJ)\hdb-sqlite.obj \
92 $(OBJ)\hdb-keytab.obj \
93 $(OBJ)\hdb-mitdb.obj \
100 $(gen_files_hdb:.x=.obj) \
103 $(OBJ)\hdb_err.c $(OBJ)\hdb_err.h: hdb_err.et
105 $(BINDIR)\compile_et.exe $(SRCDIR)\hdb_err.et
108 $(OBJ)\hdb-protos.h: $(dist_libhdb_la_SOURCES)
109 $(PERL) ../../cf/make-proto.pl -q -P remove -o $@ $(dist_libhdb_la_SOURCES) \
112 $(OBJ)\hdb-private.h: $(dist_libhdb_la_SOURCES)
113 $(PERL) ../../cf/make-proto.pl -q -P remote -p $@ $(dist_libhdb_la_SOURCES) \
118 $(INCDIR)\hdb-protos.h \
119 $(OBJ)\hdb-private.h \
120 $(INCDIR)\hdb_err.h \
121 $(INCDIR)\hdb_asn1.h \
122 $(INCDIR)\hdb_asn1-priv.h
126 RES=$(OBJ)\libhdb-version.res
128 $(LIBHDB): $(BINDIR)\libhdb.dll
130 $(BINDIR)\libhdb.dll: $(libhdb_OBJs) $(ldap_lib) $(LIBHEIMDAL) $(LIBSQLITE) $(LIBCOMERR) $(LIBROKEN) $(RES)
131 $(DLLGUILINK) -def:libhdb-exports.def -implib:$(LIBHDB)
135 -$(RM) $(BINDIR)\libhdb.*
139 $(LIBHDB): $(libhdb_OBJs) $(ldap_lib)
144 all:: $(INCFILES) $(LIBHDB)
150 test:: test-binaries test-run
152 test-binaries: $(OBJ)\test_dbinfo.exe $(OBJ)\test_hdbkeys.exe
154 $(OBJ)\test_dbinfo.exe: $(OBJ)\test_dbinfo.obj $(LIBHDB) $(LIBHEIMDAL) $(LIBROKEN) $(LIBVERS)
158 $(OBJ)\test_hdbkeys.exe: $(OBJ)\test_hdbkeys.obj $(LIBHDB) $(LIBHEIMDAL) $(LIBROKEN) $(LIBVERS)
168 openldap_inc_flag=-I$(OPENLDAP_INC)
173 hdb_cflags=$(openldap_inc_flag) -I$(OBJ)
176 $(C2OBJ_P) $(hdb_cflags) -DASN1_LIB
178 {$(OBJ)}.c{$(OBJ)}.obj::
179 $(C2OBJ_P) $(hdb_cflags)
182 $(PERL) ..\..\cf\w32-check-exported-symbols.pl --vs version-script.map --def libhdb-exports.def