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) -DROKEN_RENAME -DASN1_IOS_SUPPORTED
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_crmf = $(OBJ)\asn1_crmf_asn1.x
44 gen_files_rfc2459 = $(OBJ)\asn1_rfc2459_asn1.x
46 gen_files_rfc4108 = $(OBJ)\asn1_rfc4108_asn1.x
48 gen_files_ocsp = $(OBJ)\asn1_ocsp_asn1.x
50 gen_files_pkinit = $(OBJ)\asn1_pkinit_asn1.x
52 gen_files_pkcs12 = $(OBJ)\asn1_pkcs12_asn1.x
54 gen_files_pkcs8 = $(OBJ)\asn1_pkcs8_asn1.x
56 gen_files_pkcs9 = $(OBJ)\asn1_pkcs9_asn1.x
58 gen_files_pkcs10 = $(OBJ)\asn1_pkcs10_asn1.x
60 gen_files_test = $(OBJ)\asn1_test_asn1.x
62 gen_files_test_template = $(OBJ)\asn1_test_template_asn1.x
64 gen_files_digest = $(OBJ)\asn1_digest_asn1.x
66 gen_files_kx509 = $(OBJ)\asn1_kx509_asn1.x
68 gen_files_x690sample = $(OBJ)\asn1_x690sample_asn1.x
71 $(LIBEXECDIR)\asn1_compile.exe
73 $(BINDIR)\asn1_compile.exe: \
74 $(OBJ)\asn1parse.obj \
77 $(OBJ)\gen_decode.obj \
78 $(OBJ)\gen_encode.obj \
79 $(OBJ)\gen_print.obj \
82 $(OBJ)\gen_length.obj \
84 $(OBJ)\gen_template.obj \
89 $(OBJ)\asn1_compile-version.res
90 $(EXECONLINK) $(LIBROKEN) $(LIBVERS)
93 $(OBJ)\lex.c: lex.l $(OBJ)\asn1parse.h
96 $(OBJ)\lex.obj: $(OBJ)\lex.c
97 $(C2OBJ) -DYY_NO_UNISTD_H
99 $(OBJ)\asn1parse.c $(OBJ)\asn1parse.h: asn1parse.y
100 $(YACC) -o $(OBJ)\asn1parse.c --defines=$(OBJ)\asn1parse.h $**
102 $(OBJ)\asn1_err.c $(OBJ)\asn1_err.h: asn1_err.et
104 $(BINDIR)\compile_et.exe $(SRCDIR)\asn1_err.et
107 $(BINDIR)\asn1_print.exe: $(OBJ)\asn1_print.obj $(LIBHEIMDAL)
108 $(EXECONLINK) $(LIBVERS) $(LIBROKEN) $(LIBCOMERR)
111 $(BINDIR)\asn1_gen.exe: $(OBJ)\asn1_gen.obj $(LIBHEIMDAL)
112 $(EXECONLINK) $(LIBVERS) $(LIBROKEN)
119 $(OBJ)\der_free.obj \
120 $(OBJ)\der_print.obj \
121 $(OBJ)\der_length.obj \
122 $(OBJ)\der_copy.obj \
124 $(OBJ)\der_format.obj \
125 $(OBJ)\template.obj \
128 $(gen_files_rfc2459:.x=.obj) \
129 $(gen_files_rfc4108:.x=.obj) \
130 $(gen_files_cms:.x=.obj) \
131 $(gen_files_krb5:.x=.obj) \
132 $(gen_files_ocsp:.x=.obj) \
133 $(gen_files_pkinit:.x=.obj) \
134 $(gen_files_pkcs8:.x=.obj) \
135 $(gen_files_pkcs9:.x=.obj) \
136 $(gen_files_pkcs10:.x=.obj) \
137 $(gen_files_pkcs12:.x=.obj) \
138 $(gen_files_digest:.x=.obj) \
139 $(gen_files_kx509:.x=.obj) \
140 $(gen_files_x690sample:.x=.obj) \
143 $(OBJ)\oid_resolution.obj: $(LIBASN1_OBJS)
145 LIBASN1_OBJS2= $(LIBASN1_OBJS) $(OBJ)\oid_resolution.obj
147 $(LIBASN1): $(LIBASN1_OBJS2)
148 $(LIBCON_C) -out:$@ @<<
157 # Generate list of exports
159 # This target is only used during development to generate a list of
160 # symbols that are exported from all the object files in LIBASN1_OBJS.
162 exports-list.txt: $(LIBASN1_OBJS)
163 $(PERL) ..\..\cf\w32-list-externs-from-objs.pl -q -u @<< > $@
168 $(gen_files_krb5:.x=.c) : $$(@R).x
170 $(gen_files_ocsp:.x=.c) : $$(@R).x
172 $(gen_files_pkinit:.x=.c) : $$(@R).x
174 $(gen_files_pkcs8:.x=.c) : $$(@R).x
176 $(gen_files_pkcs9:.x=.c) : $$(@R).x
178 $(gen_files_pkcs10:.x=.c) : $$(@R).x
180 $(gen_files_pkcs12:.x=.c) : $$(@R).x
182 $(gen_files_digest:.x=.c) : $$(@R).x
184 $(gen_files_kx509:.x=.c) : $$(@R).x
186 $(gen_files_rfc2459:.x=.c) : $$(@R).x
188 $(gen_files_rfc4108:.x=.c) : $$(@R).x
190 $(gen_files_cms:.x=.c) : $$(@R).x
192 $(gen_files_crmf:.x=.c) : $$(@R).x
194 $(gen_files_x690sample:.x=.c) : $$(@R).x
196 $(gen_files_test:.x=.c) : $$(@R).x
198 $(gen_files_test_template:.x=.c) : $$(@R).x
200 $(gen_files_krb5) $(OBJ)\krb5_asn1.hx: $(BINDIR)\asn1_compile.exe krb5.asn1 krb5.opt
202 $(BINDIR)\asn1_compile.exe \
205 --decorate="Principal:PrincipalNameAttrs:nameattrs?" \
206 --option-file=$(SRCDIR)\krb5.opt \
207 $(SRCDIR)\krb5.asn1 krb5_asn1 \
208 || ($(RM) $(OBJ)\krb5_asn1.h ; exit /b 1)
211 $(gen_files_ocsp) $(OBJ)\ocsp_asn1.hx: $(BINDIR)\asn1_compile.exe ocsp.asn1
213 $(BINDIR)\asn1_compile.exe \
216 --option-file=$(SRCDIR)\ocsp.opt \
217 $(SRCDIR)\ocsp.asn1 \
219 || ($(RM) $(OBJ)\ocsp_asn1.h ; exit /b 1)
222 $(gen_files_pkinit) $(OBJ)\pkinit_asn1.hx: $(BINDIR)\asn1_compile.exe pkinit.asn1
224 $(BINDIR)\asn1_compile.exe --template --one-code-file $(SRCDIR)\pkinit.asn1 pkinit_asn1 \
225 || ($(RM) $(OBJ)\pkinit_asn1.h ; exit /b 1)
228 $(gen_files_pkcs8) $(OBJ)\pkcs8_asn1.hx: $(BINDIR)\asn1_compile.exe pkcs8.asn1
230 $(BINDIR)\asn1_compile.exe --template --one-code-file $(SRCDIR)\pkcs8.asn1 pkcs8_asn1 \
231 || ($(RM) $(OBJ)\pkcs8_asn1.h ; exit /b 1)
234 $(gen_files_pkcs9) $(OBJ)\pkcs9_asn1.hx: $(BINDIR)\asn1_compile.exe pkcs9.asn1
236 $(BINDIR)\asn1_compile.exe --template --one-code-file $(SRCDIR)\pkcs9.asn1 pkcs9_asn1 \
237 || ($(RM) $(OBJ)\pkcs9_asn1.h ; exit /b 1)
240 $(gen_files_pkcs10) $(OBJ)\pkcs10_asn1.hx: $(BINDIR)\asn1_compile.exe pkcs10.asn1
242 $(BINDIR)\asn1_compile.exe \
245 --option-file=$(SRCDIR)\pkcs10.opt \
246 $(SRCDIR)\pkcs10.asn1 \
248 || ($(RM) $(OBJ)\pkcs10_asn1.h ; exit /b 1)
251 $(gen_files_pkcs12) $(OBJ)\pkcs12_asn1.hx: $(BINDIR)\asn1_compile.exe pkcs12.asn1
253 $(BINDIR)\asn1_compile.exe --template --one-code-file $(SRCDIR)\pkcs12.asn1 pkcs12_asn1 \
254 || ($(RM) $(OBJ)\pkcs12_asn1.h ; exit /b 1)
257 $(gen_files_digest) $(OBJ)\digest_asn1.hx: $(BINDIR)\asn1_compile.exe digest.asn1
259 $(BINDIR)\asn1_compile.exe --template --one-code-file $(SRCDIR)\digest.asn1 digest_asn1 \
260 || ($(RM) $(OBJ)\digest_asn1.h ; exit /b 1)
263 $(gen_files_kx509) $(OBJ)\kx509_asn1.hx: $(BINDIR)\asn1_compile.exe kx509.asn1
265 $(BINDIR)\asn1_compile.exe --template --one-code-file $(SRCDIR)\kx509.asn1 kx509_asn1 \
266 || ($(RM) $(OBJ)\kx509_asn1.h ; exit /b 1)
269 $(gen_files_rfc2459) $(OBJ)\rfc2459_asn1.hx: $(BINDIR)\asn1_compile.exe rfc2459.asn1
271 $(BINDIR)\asn1_compile.exe \
274 --option-file=$(SRCDIR)\rfc2459.opt \
275 $(SRCDIR)\rfc2459.asn1 rfc2459_asn1 \
276 || ($(RM) $(OBJ)\rfc2459_asn1.h ; exit /b 1)
279 $(gen_files_rfc4108) $(OBJ)\rfc4108_asn1.hx: $(BINDIR)\asn1_compile.exe rfc4108.asn1
281 $(BINDIR)\asn1_compile.exe \
284 $(SRCDIR)\rfc4108.asn1 rfc4108_asn1 \
285 || ($(RM) $(OBJ)\rfc4108_asn1.h ; exit /b 1)
288 $(gen_files_cms) $(OBJ)\cms_asn1.hx: $(BINDIR)\asn1_compile.exe cms.asn1 cms.opt
290 $(BINDIR)\asn1_compile.exe \
292 --one-code-file --option-file=$(SRCDIR)\cms.opt \
293 $(SRCDIR)\cms.asn1 cms_asn1 \
294 || ($(RM) $(OBJ)\cms_asn1.h ; exit /b 1)
297 $(gen_files_crmf) $(OBJ)\crmf_asn1.hx: $(BINDIR)\asn1_compile.exe crmf.asn1 crmf.opt
299 $(BINDIR)\asn1_compile.exe \
301 --one-code-file --option-file=$(SRCDIR)\crmf.opt \
302 $(SRCDIR)\crmf.asn1 crmf_asn1 \
303 || ($(RM) $(OBJ)\crmf_asn1.h ; exit /b 1)
306 $(gen_files_x690sample) $(OBJ)\x690sample_asn1.hx: $(BINDIR)\asn1_compile.exe x690sample.asn1
308 $(BINDIR)\asn1_compile.exe \
311 $(SRCDIR)\x690sample.asn1 x690sample_asn1 \
312 || ($(RM) $(OBJ)\x690sample_asn1.h ; exit /b 1)
315 $(gen_files_test) $(OBJ)\test_asn1.hx: $(BINDIR)\asn1_compile.exe test.asn1
317 $(BINDIR)\asn1_compile.exe \
319 --decorate="TESTDecorated:TESTuint32:version2?" \
320 --one-code-file --sequence=TESTSeqOf \
321 $(SRCDIR)\test.asn1 test_asn1 \
322 || ($(RM) $(OBJ)\test_asn1.h ; exit /b 1)
325 $(gen_files_test_template) $(OBJ)\test_template_asn1.hx: $(BINDIR)\asn1_compile.exe test.asn1
327 $(BINDIR)\asn1_compile.exe \
329 --decorate="TESTDecorated:TESTuint32:version2?" \
331 --sequence=TESTSeqOf \
332 $(SRCDIR)\test.asn1 test_template_asn1 \
333 || ($(RM) $(OBJ)\test_template_asn1.h ; exit /b 1)
338 $(INCDIR)\heim_asn1.h \
339 $(INCDIR)\der-protos.h \
340 $(INCDIR)\der-private.h \
341 $(INCDIR)\asn1-common.h \
342 $(INCDIR)\asn1-template.h \
345 $(INCDIR)\der-protos.h: $(OBJ)\der-protos.h
348 $(INCDIR)\asn1_err.h \
349 $(INCDIR)\cms_asn1.h \
350 $(INCDIR)\crmf_asn1.h \
351 $(INCDIR)\digest_asn1.h \
352 $(INCDIR)\krb5_asn1.h \
353 $(INCDIR)\kx509_asn1.h \
354 $(INCDIR)\ocsp_asn1.h \
355 $(INCDIR)\pkcs12_asn1.h \
356 $(INCDIR)\pkcs8_asn1.h \
357 $(INCDIR)\pkcs9_asn1.h \
358 $(INCDIR)\pkcs10_asn1.h \
359 $(INCDIR)\pkinit_asn1.h \
360 $(INCDIR)\rfc2459_asn1.h \
361 $(INCDIR)\rfc4108_asn1.h \
362 $(INCDIR)\x690sample_asn1.h \
363 $(OBJ)\krb5_asn1-priv.h \
364 $(OBJ)\ocsp_asn1-priv.h \
365 $(OBJ)\pkinit_asn1-priv.h \
366 $(OBJ)\cms_asn1-priv.h \
367 $(OBJ)\crmf_asn1-priv.h \
368 $(OBJ)\rfc2459_asn1-priv.h \
369 $(OBJ)\rfc4108_asn1-priv.h \
370 $(OBJ)\x690sample_asn1-priv.h \
371 $(OBJ)\pkcs8_asn1-priv.h \
372 $(OBJ)\pkcs9_asn1-priv.h \
373 $(OBJ)\pkcs10_asn1-priv.h \
374 $(OBJ)\pkcs12_asn1-priv.h \
375 $(OBJ)\digest_asn1-priv.h \
376 $(OBJ)\kx509_asn1-priv.h \
377 $(OBJ)\test_template_asn1.h \
378 $(OBJ)\test_template_asn1-priv.h \
380 $(OBJ)\test_asn1-priv.h
382 libasn1_base_SOURCES= \
402 $(OBJ)\der-protos.h: $(libasn1_SOURCES)
403 $(PERL) ..\..\cf\make-proto.pl -q -P remove -o $(OBJ)\der-protos.h $(libasn1_base_SOURCES) $(libasn1_SOURCES) || $(RM) $(OBJ)\der-protos.h
405 $(OBJ)\der-private.h: $(libasn1_SOURCES)
406 $(PERL) ..\..\cf\make-proto.pl -q -P remove -p $(OBJ)\der-private.h $(libasn1_base_SOURCES) $(libasn1_SOURCES) || $(RM) $(OBJ)\der-private.h
409 -$(RM) $(INCDIR)\der-protos.h
411 all:: $(INCFILES) $(GENINCFILES) $(ASN1_BINARIES) $(LIBASN1)
413 all-tools:: $(LIBEXECDIR)\asn1_print.exe $(BINDIR)\asn1_gen.exe
417 -$(RM) $(GENINCFILES)
418 -$(RM) $(ASN1_BINARIES:.exe=.*)
420 -$(RM) $(LIBEXECDIR)\asn1_print.*
421 -$(RM) $(LIBEXECDIR)\asn1_gen.*
424 $(OBJ)\check-der.exe \
425 $(OBJ)\check-gen-template.exe \
426 $(OBJ)\check-timegm.exe \
427 $(OBJ)\check-ber.exe \
428 $(OBJ)\check-template.exe
430 test-binaries: $(TEST_BINARIES)
435 -check-gen-template.exe
441 test:: test-binaries test-run
444 -$(RM) $(TEST_BINARIES:.exe=*)
446 $(OBJ)\check-ber.exe: $(OBJ)\check-ber.obj \
447 $(LIBHEIMDAL) $(LIBROKEN)
451 $(OBJ)\check-der.exe: $(OBJ)\check-der.obj $(OBJ)\check-common.obj \
452 $(LIBHEIMDAL) $(LIBROKEN)
456 $(OBJ)\check-gen-template.exe: $(OBJ)\check-gen.obj $(OBJ)\check-common.obj \
457 $(LIBHEIMDAL) $(LIBROKEN) $(gen_files_test_template:.x=.obj)
461 $(OBJ)\check-timegm.exe: $(OBJ)\check-timegm.obj \
462 $(LIBHEIMDAL) $(LIBROKEN)
466 $(OBJ)\check-template.exe: $(OBJ)\check-template.obj $(OBJ)\check-common.obj \
467 $(LIBHEIMDAL) $(LIBROKEN) $(gen_files_test:.x=.obj)