hdb: hdb_ldap_common NULL dereference
[heimdal.git] / lib / hdb / NTMakefile
blob01671b07805cf6783b80bf64a41533c237907fe4
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 = $(OBJ)\asn1_hdb_asn1.x
38 $(gen_files_hdb) $(OBJ)\hdb_asn1.hx $(OBJ)\hdb_asn1-priv.hx: $(BINDIR)\asn1_compile.exe hdb.asn1
39         cd $(OBJ)
40         $(BINDIR)\asn1_compile.exe --sequence=HDB-Ext-KeySet --sequence=Keys --one-code-file $(SRCDIR)\hdb.asn1 hdb_asn1
41         cd $(SRCDIR)
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)
53         $(DLLPREP)
55 clean::
56         -$(RM) $(ldap_dll)
57         -$(RM) $(ldap_lib)
59 !else
61 ldap = $(OBJ)\hdb-ldap.obj
62 ldap_c = hdb-ldap.c
64 !endif
66 dist_libhdb_la_SOURCES =                        \
67         common.c                                \
68         db.c                                    \
69         db3.c                                   \
70         ext.c                                   \
71         $(ldap_c)                               \
72         hdb.c                                   \
73         hdb-sqlite.c                            \
74         hdb-keytab.c                            \
75         hdb-mitdb.c                             \
76         hdb-mdb.c                               \
77         hdb_locl.h                              \
78         keys.c                                  \
79         keytab.c                                \
80         dbinfo.c                                \
81         mkey.c                                  \
82         ndbm.c                                  \
83         print.c
85 libhdb_OBJs = \
86         $(OBJ)\common.obj       \
87         $(OBJ)\db.obj           \
88         $(OBJ)\db3.obj          \
89         $(OBJ)\ext.obj          \
90         $(ldap)                 \
91         $(OBJ)\hdb.obj          \
92         $(OBJ)\hdb-sqlite.obj   \
93         $(OBJ)\hdb-keytab.obj   \
94         $(OBJ)\hdb-mitdb.obj    \
95         $(OBJ)\keys.obj         \
96         $(OBJ)\keytab.obj       \
97         $(OBJ)\dbinfo.obj       \
98         $(OBJ)\mkey.obj         \
99         $(OBJ)\ndbm.obj         \
100         $(OBJ)\print.obj        \
101         $(gen_files_hdb:.x=.obj)        \
102         $(OBJ)\hdb_err.obj
104 $(OBJ)\hdb_err.c $(OBJ)\hdb_err.h: hdb_err.et
105         cd $(OBJ)
106         $(BINDIR)\compile_et.exe $(SRCDIR)\hdb_err.et
107         cd $(SRCDIR)
109 $(OBJ)\hdb-protos.h: $(dist_libhdb_la_SOURCES)
110         $(PERL) ../../cf/make-proto.pl -q -P remove -o $@ $(dist_libhdb_la_SOURCES) \
111                 || $(RM) $@
113 $(OBJ)\hdb-private.h: $(dist_libhdb_la_SOURCES)
114         $(PERL) ../../cf/make-proto.pl -q -P remote -p $@ $(dist_libhdb_la_SOURCES) \
115                 || $(RM) $@
117 INCFILES=                       \
118         $(INCDIR)\hdb.h         \
119         $(INCDIR)\hdb-protos.h  \
120         $(OBJ)\hdb-private.h    \
121         $(INCDIR)\hdb_err.h     \
122         $(INCDIR)\hdb_asn1.h    \
123         $(INCDIR)\hdb_asn1-priv.h
125 !ifndef STATICLIBS
127 RES=$(OBJ)\libhdb-version.res
129 $(LIBHDB): $(BINDIR)\libhdb.dll
131 $(BINDIR)\libhdb.dll: $(libhdb_OBJs) $(ldap_lib) $(LIBHEIMBASE) $(LIBHEIMDAL) $(LIBSQLITE) $(LIBCOMERR) $(LIBROKEN) $(RES)
132         $(DLLGUILINK) -def:libhdb-exports.def -implib:$(LIBHDB)
133         $(DLLPREP_NODIST)
135 clean::
136         -$(RM) $(BINDIR)\libhdb.*
138 !else
140 $(LIBHDB): $(libhdb_OBJs) $(ldap_lib)
141         $(LIBCON)
143 !endif
145 all:: $(INCFILES) $(LIBHDB)
147 clean::
148         -$(RM) $(INCFILES)
149         -$(RM) $(LIBHDB)
151 test:: test-binaries test-run
153 test-binaries: $(OBJ)\test_dbinfo.exe $(OBJ)\test_hdbkeys.exe $(OBJ)\test_hdbplugin.exe
155 $(OBJ)\test_dbinfo.exe: $(OBJ)\test_dbinfo.obj $(LIBHDB) $(LIBHEIMDAL) $(LIBROKEN) $(LIBVERS)
156         $(EXECONLINK)
157         $(EXEPREP_NODIST)
159 $(OBJ)\test_hdbkeys.exe: $(OBJ)\test_hdbkeys.obj $(LIBHDB) $(LIBHEIMDAL) $(LIBROKEN) $(LIBVERS)
160         $(EXECONLINK)
161         $(EXEPREP_NODIST)
163 $(OBJ)\test_hdbplugin.exe: $(OBJ)\test_hdbplugin.obj $(LIBHDB) $(LIBHEIMDAL) $(LIBROKEN) $(LIBVERS)
164         $(EXECONLINK)
165         $(EXEPREP_NODIST)
167 test-run:
168         cd $(OBJ)
169         -test_dbinfo.exe
170         -test_hdbkeys.exe
171         -test_hdbplugin.exe
172         cd $(SRCDIR)
174 !ifdef OPENLDAP_INC
175 openldap_inc_flag=-I$(OPENLDAP_INC)
176 !else
177 openldap_inc_flag=
178 !endif
180 hdb_cflags=$(openldap_inc_flag) -I$(OBJ)
182 {}.c{$(OBJ)}.obj::
183         $(C2OBJ_P) $(hdb_cflags) -DASN1_LIB
185 {$(OBJ)}.c{$(OBJ)}.obj::
186         $(C2OBJ_P) $(hdb_cflags)
188 test-exports:
189         $(PERL) ..\..\cf\w32-check-exported-symbols.pl --vs version-script.map --def libhdb-exports.def
191 test:: test-exports