Windows: Check exported symbols
[heimdal.git] / lib / hdb / NTMakefile
blob4b1acea849c3a01db9431151c7a38f2dd16ec35f
1 ########################################################################
3 # Copyright (c) 2009, Secure Endpoints Inc.
4 # All rights reserved.
5
6 # Redistribution and use in source and binary forms, with or without
7 # modification, are permitted provided that the following conditions
8 # are met:
9
10 # - Redistributions of source code must retain the above copyright
11 #   notice, this list of conditions and the following disclaimer.
12
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
16 #   distribution.
17
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.
30
32 RELDIR=lib\hdb
34 !include ../../windows/NTMakefile.w32 
36 gen_files_hdb = \
37         $(OBJ)\asn1_Salt.x \
38         $(OBJ)\asn1_Key.x \
39         $(OBJ)\asn1_Event.x \
40         $(OBJ)\asn1_HDBFlags.x \
41         $(OBJ)\asn1_GENERATION.x \
42         $(OBJ)\asn1_HDB_Ext_PKINIT_acl.x \
43         $(OBJ)\asn1_HDB_Ext_PKINIT_cert.x \
44         $(OBJ)\asn1_HDB_Ext_PKINIT_hash.x \
45         $(OBJ)\asn1_HDB_Ext_Constrained_delegation_acl.x \
46         $(OBJ)\asn1_HDB_Ext_Lan_Manager_OWF.x \
47         $(OBJ)\asn1_HDB_Ext_Password.x \
48         $(OBJ)\asn1_HDB_Ext_Aliases.x \
49         $(OBJ)\asn1_HDB_extension.x \
50         $(OBJ)\asn1_HDB_extensions.x \
51         $(OBJ)\asn1_hdb_entry.x \
52         $(OBJ)\asn1_hdb_entry_alias.x \
53         $(OBJ)\asn1_hdb_keyset.x
55 $(gen_files_hdb) $(OBJ)\hdb_asn1.hx $(OBJ)\hdb_asn1-priv.hx: $(BINDIR)\asn1_compile.exe hdb.asn1
56         cd $(OBJ)
57         $(BINDIR)\asn1_compile.exe $(SRCDIR)\hdb.asn1 hdb_asn1
58         cd $(SRCDIR)
60 $(gen_files_hdb:.x=.c): $$(@R).x
62 !ifdef OPENLDAP_MODULE
64 ldap_dll = $(BINDIR)\hdb_ldap.dll
65 ldap_lib = $(LIBDIR)\hdb_ldap.lib
66 ldap_objs = $(OBJ)\hdb-ldap.obj
68 $(ldap_dll): $(ldap_objs)
69         $(DLLGUILINK) -implib:$(ldap_lib)
70         $(DLLPREP)
72 clean::
73         -$(RM) $(ldap_dll)
74         -$(RM) $(ldap_lib)
76 !else
78 ldap = $(OBJ)\hdb-ldap.obj
79 ldap_c = hdb-ldap.c
81 !endif
83 dist_libhdb_la_SOURCES =                        \
84         common.c                                \
85         db.c                                    \
86         db3.c                                   \
87         ext.c                                   \
88         $(ldap_c)                               \
89         hdb.c                                   \
90         hdb-sqlite.c                            \
91         hdb-keytab.c                            \
92         hdb-mitdb.c                             \
93         hdb_locl.h                              \
94         keys.c                                  \
95         keytab.c                                \
96         dbinfo.c                                \
97         mkey.c                                  \
98         ndbm.c                                  \
99         print.c
101 libhdb_OBJs = \
102         $(OBJ)\common.obj       \
103         $(OBJ)\db.obj           \
104         $(OBJ)\db3.obj          \
105         $(OBJ)\ext.obj          \
106         $(ldap)                 \
107         $(OBJ)\hdb.obj          \
108         $(OBJ)\hdb-sqlite.obj   \
109         $(OBJ)\hdb-keytab.obj   \
110         $(OBJ)\hdb-mitdb.obj    \
111         $(OBJ)\keys.obj         \
112         $(OBJ)\keytab.obj       \
113         $(OBJ)\dbinfo.obj       \
114         $(OBJ)\mkey.obj         \
115         $(OBJ)\ndbm.obj         \
116         $(OBJ)\print.obj        \
117         $(gen_files_hdb:.x=.obj)        \
118         $(OBJ)\hdb_err.obj
120 $(OBJ)\hdb_err.c $(OBJ)\hdb_err.h: hdb_err.et
121         cd $(OBJ)
122         $(BINDIR)\compile_et.exe $(SRCDIR)\hdb_err.et
123         cd $(SRCDIR)
125 $(OBJ)\hdb-protos.h: $(dist_libhdb_la_SOURCES)
126         $(PERL) ../../cf/make-proto.pl -q -P remove -o $@ $(dist_libhdb_la_SOURCES) \
127                 || $(RM) $@
129 $(OBJ)\hdb-private.h: $(dist_libhdb_la_SOURCES)
130         $(PERL) ../../cf/make-proto.pl -q -P remote -p $@ $(dist_libhdb_la_SOURCES) \
131                 || $(RM) $@
133 INCFILES=                       \
134         $(INCDIR)\hdb.h         \
135         $(INCDIR)\hdb-protos.h  \
136         $(OBJ)\hdb-private.h    \
137         $(INCDIR)\hdb_err.h     \
138         $(INCDIR)\hdb_asn1.h    \
139         $(INCDIR)\hdb_asn1-priv.h
141 !ifndef STATICLIBS
143 RES=$(OBJ)\libhdb-version.res
145 $(LIBHDB): $(BINDIR)\libhdb.dll
147 $(BINDIR)\libhdb.dll: $(libhdb_OBJs) $(ldap_lib) $(LIBHEIMDAL) $(LIBSQLITE) $(LIBCOMERR) $(LIBROKEN) $(RES)
148         $(DLLGUILINK) -def:libhdb-exports.def -implib:$(LIBHDB)
149         $(DLLPREP)
151 !else
153 $(LIBHDB): $(libhdb_OBJs) $(ldap_lib)
154         $(LIBCON)
156 !endif
158 all:: $(INCFILES) $(LIBHDB)
160 clean::
161         -$(RM) $(INCFILES)
162         -$(RM) $(LIBHDB)
164 test:: test-binaries test-run
166 test-binaries: $(OBJ)\test_dbinfo.exe $(OBJ)\test_hdbkeys.exe
168 $(OBJ)\test_dbinfo.exe: $(OBJ)\test_dbinfo.obj $(LIBHDB) $(LIBHEIMDAL) $(LIBROKEN) $(LIBVERS)
169         $(EXECONLINK)
170         $(EXEPREP_NODIST)
172 $(OBJ)\test_hdbkeys.exe: $(OBJ)\test_hdbkeys.obj $(LIBHDB) $(LIBHEIMDAL) $(LIBROKEN) $(LIBVERS)
173         $(EXECONLINK)
174         $(EXEPREP_NODIST)
176 test-run:
177         cd $(OBJ)
178         test_dbinfo.exe
179         test_hdbkeys.exe
180         cd $(SRCDIR)
182 !ifdef OPENLDAP_INC
183 openldap_inc_flag=-I$(OPENLDAP_INC)
184 !else
185 openldap_inc_flag=
186 !endif
188 hdb_cflags=$(openldap_inc_flag) -I$(OBJ)
190 {}.c{$(OBJ)}.obj::
191         $(C2OBJ_P) $(hdb_cflags)
193 {$(OBJ)}.c{$(OBJ)}.obj::
194         $(C2OBJ_P) $(hdb_cflags)
196 test-exports:
197         $(PERL) ..\..\cf\w32-check-exported-symbols.pl --vs version-script.map --def libhdb-exports.def
199 test:: test-exports