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 intcflags=-I$(SRCDIR) -I$(OBJ)
36 !include ../../windows/NTMakefile.w32
38 gen_files_krb5 = $(OBJ)\asn1_krb5_asn1.x
40 gen_files_cms = $(OBJ)\asn1_cms_asn1.x
42 gen_files_rfc2459 = $(OBJ)\asn1_rfc2459_asn1.x
44 gen_files_pkinit = $(OBJ)\asn1_pkinit_asn1.x
46 gen_files_pkcs12 = $(OBJ)\asn1_pkcs12_asn1.x
48 gen_files_pkcs8 = $(OBJ)\asn1_pkcs8_asn1.x
50 gen_files_pkcs9 = $(OBJ)\asn1_pkcs9_asn1.x
52 gen_files_test = $(OBJ)\asn1_test_asn1.x
54 gen_files_digest = $(OBJ)\asn1_digest_asn1.x
56 gen_files_kx509 = $(OBJ)\asn1_kx509_asn1.x
59 $(LIBEXECDIR)\asn1_compile.exe
61 $(BINDIR)\asn1_compile.exe: \
62 $(OBJ)\asn1parse.obj \
65 $(OBJ)\gen_decode.obj \
66 $(OBJ)\gen_encode.obj \
69 $(OBJ)\gen_length.obj \
71 $(OBJ)\gen_template.obj \
76 $(OBJ)\asn1_compile-version.res
77 $(EXECONLINK) $(LIBROKEN) $(LIBVERS)
80 $(OBJ)\lex.c: lex.l $(OBJ)\asn1parse.h
83 $(OBJ)\lex.obj: $(OBJ)\lex.c
84 $(C2OBJ) -DYY_NO_UNISTD_H
86 $(OBJ)\asn1parse.c $(OBJ)\asn1parse.h: asn1parse.y
87 $(YACC) -o $(OBJ)\asn1parse.c --defines=$(OBJ)\asn1parse.h $**
89 $(OBJ)\asn1_err.c $(OBJ)\asn1_err.h: asn1_err.et
91 $(BINDIR)\compile_et.exe $(SRCDIR)\asn1_err.et
94 $(BINDIR)\asn1_print.exe: $(OBJ)\asn1_print.obj $(LIBHEIMDAL)
95 $(EXECONLINK) $(LIBVERS) $(LIBROKEN) $(LIBCOMERR)
98 $(BINDIR)\asn1_gen.exe: $(OBJ)\asn1_gen.obj $(LIBHEIMDAL)
99 $(EXECONLINK) $(LIBVERS) $(LIBROKEN)
106 $(OBJ)\der_free.obj \
107 $(OBJ)\der_length.obj \
108 $(OBJ)\der_copy.obj \
110 $(OBJ)\der_format.obj \
113 $(gen_files_rfc2459:.x=.obj) \
114 $(gen_files_cms:.x=.obj) \
115 $(gen_files_krb5:.x=.obj) \
116 $(gen_files_pkinit:.x=.obj) \
117 $(gen_files_pkcs8:.x=.obj) \
118 $(gen_files_pkcs9:.x=.obj) \
119 $(gen_files_pkcs12:.x=.obj) \
120 $(gen_files_digest:.x=.obj) \
121 $(gen_files_kx509:.x=.obj) \
124 $(LIBASN1): $(LIBASN1_OBJS)
125 $(LIBCON_C) -out:$@ @<<
134 # Generate list of exports
136 # This target is only used during development to generate a list of
137 # symbols that are exported from all the object files in LIBASN1_OBJS.
139 exports-list.txt: $(LIBASN1_OBJS)
140 $(PERL) ..\..\cf\w32-list-externs-from-objs.pl -q -u @<< > $@
145 $(gen_files_krb5:.x=.c) : $$(@R).x
147 $(gen_files_pkinit:.x=.c) : $$(@R).x
149 $(gen_files_pkcs8:.x=.c) : $$(@R).x
151 $(gen_files_pkcs9:.x=.c) : $$(@R).x
153 $(gen_files_pkcs12:.x=.c) : $$(@R).x
155 $(gen_files_digest:.x=.c) : $$(@R).x
157 $(gen_files_kx509:.x=.c) : $$(@R).x
159 $(gen_files_rfc2459:.x=.c) : $$(@R).x
161 $(gen_files_cms:.x=.c) : $$(@R).x
163 $(gen_files_test:.x=.c) : $$(@R).x
165 $(gen_files_krb5) $(OBJ)\krb5_asn1.hx: $(BINDIR)\asn1_compile.exe krb5.asn1 krb5.opt
167 $(BINDIR)\asn1_compile.exe \
169 --option-file=$(SRCDIR)\krb5.opt \
170 $(SRCDIR)\krb5.asn1 krb5_asn1 \
171 || ($(RM) $(OBJ)\krb5_asn1.h ; exit /b 1)
174 $(gen_files_pkinit) $(OBJ)\pkinit_asn1.hx: $(BINDIR)\asn1_compile.exe pkinit.asn1
176 $(BINDIR)\asn1_compile.exe --one-code-file $(SRCDIR)\pkinit.asn1 pkinit_asn1 \
177 || ($(RM) $(OBJ)\pkinit_asn1.h ; exit /b 1)
180 $(gen_files_pkcs8) $(OBJ)\pkcs8_asn1.hx: $(BINDIR)\asn1_compile.exe pkcs8.asn1
182 $(BINDIR)\asn1_compile.exe --one-code-file $(SRCDIR)\pkcs8.asn1 pkcs8_asn1 \
183 || ($(RM) $(OBJ)\pkcs8_asn1.h ; exit /b 1)
186 $(gen_files_pkcs9) $(OBJ)\pkcs9_asn1.hx: $(BINDIR)\asn1_compile.exe pkcs9.asn1
188 $(BINDIR)\asn1_compile.exe --one-code-file $(SRCDIR)\pkcs9.asn1 pkcs9_asn1 \
189 || ($(RM) $(OBJ)\pkcs9_asn1.h ; exit /b 1)
192 $(gen_files_pkcs12) $(OBJ)\pkcs12_asn1.hx: $(BINDIR)\asn1_compile.exe pkcs12.asn1
194 $(BINDIR)\asn1_compile.exe --one-code-file $(SRCDIR)\pkcs12.asn1 pkcs12_asn1 \
195 || ($(RM) $(OBJ)\pkcs12_asn1.h ; exit /b 1)
198 $(gen_files_digest) $(OBJ)\digest_asn1.hx: $(BINDIR)\asn1_compile.exe digest.asn1
200 $(BINDIR)\asn1_compile.exe --one-code-file $(SRCDIR)\digest.asn1 digest_asn1 \
201 || ($(RM) $(OBJ)\digest_asn1.h ; exit /b 1)
204 $(gen_files_kx509) $(OBJ)\kx509_asn1.hx: $(BINDIR)\asn1_compile.exe kx509.asn1
206 $(BINDIR)\asn1_compile.exe --one-code-file $(SRCDIR)\kx509.asn1 kx509_asn1 \
207 || ($(RM) $(OBJ)\kx509_asn1.h ; exit /b 1)
210 $(gen_files_rfc2459) $(OBJ)\rfc2459_asn1.hx: $(BINDIR)\asn1_compile.exe rfc2459.asn1
212 $(BINDIR)\asn1_compile.exe \
214 --preserve-binary=TBSCertificate \
215 --preserve-binary=TBSCRLCertList \
216 --preserve-binary=Name \
217 --sequence=GeneralNames \
218 --sequence=Extensions \
219 --sequence=CRLDistributionPoints \
220 $(SRCDIR)\rfc2459.asn1 rfc2459_asn1 \
221 || ($(RM) $(OBJ)\rfc2459_asn1.h ; exit /b 1)
224 $(gen_files_cms) $(OBJ)\cms_asn1.hx: $(BINDIR)\asn1_compile.exe cms.asn1 cms.opt
226 $(BINDIR)\asn1_compile.exe \
227 --one-code-file --option-file=$(SRCDIR)\cms.opt \
228 $(SRCDIR)\cms.asn1 cms_asn1 \
229 || ($(RM) $(OBJ)\cms_asn1.h ; exit /b 1)
232 $(gen_files_test) $(OBJ)\test_asn1.hx: $(BINDIR)\asn1_compile.exe test.asn1
234 $(BINDIR)\asn1_compile.exe \
235 --one-code-file --sequence=TESTSeqOf \
236 $(SRCDIR)\test.asn1 test_asn1 \
237 || ($(RM) $(OBJ)\test_asn1.h ; exit /b 1)
242 $(INCDIR)\heim_asn1.h \
243 $(INCDIR)\der-protos.h \
244 $(INCDIR)\der-private.h \
245 $(INCDIR)\asn1-common.h \
246 $(INCDIR)\asn1-template.h \
249 $(INCDIR)\der-protos.h: $(OBJ)\der-protos.h
252 $(INCDIR)\asn1_err.h \
253 $(INCDIR)\cms_asn1.h \
254 $(INCDIR)\digest_asn1.h \
255 $(INCDIR)\krb5_asn1.h \
256 $(INCDIR)\kx509_asn1.h \
257 $(INCDIR)\pkcs12_asn1.h \
258 $(INCDIR)\pkcs8_asn1.h \
259 $(INCDIR)\pkcs9_asn1.h \
260 $(INCDIR)\pkinit_asn1.h \
261 $(INCDIR)\rfc2459_asn1.h \
262 $(OBJ)\krb5_asn1-priv.h \
263 $(OBJ)\pkinit_asn1-priv.h \
264 $(OBJ)\cms_asn1-priv.h \
265 $(OBJ)\rfc2459_asn1-priv.h \
266 $(OBJ)\pkcs8_asn1-priv.h \
267 $(OBJ)\pkcs9_asn1-priv.h \
268 $(OBJ)\pkcs12_asn1-priv.h \
269 $(OBJ)\digest_asn1-priv.h \
270 $(OBJ)\kx509_asn1-priv.h \
272 $(OBJ)\test_asn1-priv.h
289 $(OBJ)\der-protos.h: $(libasn1_SOURCES)
290 $(PERL) ..\..\cf\make-proto.pl -q -P remove -o $(OBJ)\der-protos.h $(libasn1_SOURCES) || $(RM) $(OBJ)\der-protos.h
292 $(OBJ)\der-private.h: $(libasn1_SOURCES)
293 $(PERL) ..\..\cf\make-proto.pl -q -P remove -p $(OBJ)\der-private.h $(libasn1_SOURCES) || $(RM) $(OBJ)\der-private.h
296 -$(RM) $(INCDIR)\der-protos.h
298 all:: $(INCFILES) $(GENINCFILES) $(ASN1_BINARIES) $(LIBASN1)
300 all-tools:: $(LIBEXECDIR)\asn1_print.exe $(BINDIR)\asn1_gen.exe
304 -$(RM) $(GENINCFILES)
305 -$(RM) $(ASN1_BINARIES:.exe=.*)
307 -$(RM) $(LIBEXECDIR)\asn1_print.*
308 -$(RM) $(LIBEXECDIR)\asn1_gen.*
311 $(OBJ)\check-der.exe \
312 $(OBJ)\check-gen.exe \
313 $(OBJ)\check-timegm.exe \
314 $(OBJ)\check-ber.exe \
315 $(OBJ)\check-template.exe \
317 test-binaries: $(TEST_BINARIES)
328 test:: test-binaries test-run
331 -$(RM) $(TEST_BINARIES:.exe=*)
333 $(OBJ)\check-ber.exe: $(OBJ)\check-ber.obj \
334 $(LIBHEIMDAL) $(LIBROKEN)
338 $(OBJ)\check-der.exe: $(OBJ)\check-der.obj $(OBJ)\check-common.obj \
339 $(LIBHEIMDAL) $(LIBROKEN)
343 $(OBJ)\check-gen.exe: $(OBJ)\check-gen.obj $(OBJ)\check-common.obj \
344 $(LIBHEIMDAL) $(LIBROKEN) $(gen_files_test:.x=.obj)
348 $(OBJ)\check-timegm.exe: $(OBJ)\check-timegm.obj \
349 $(LIBHEIMDAL) $(LIBROKEN)
353 $(OBJ)\check-template.exe: $(OBJ)\check-template.obj $(OBJ)\check-common.obj \
354 $(LIBHEIMDAL) $(LIBROKEN) $(gen_files_test:.x=.obj)