xref: /freebsd/crypto/heimdal/lib/asn1/Makefile.am (revision 95eb4b873b6a8b527c5bd78d7191975dfca38998)
1# $Id$
2
3include $(top_srcdir)/Makefile.am.common
4
5YFLAGS = -d -t
6
7lib_LTLIBRARIES = libasn1.la
8libasn1_la_LDFLAGS = -version-info 8:0:0
9
10noinst_LTLIBRARIES = libasn1base.la
11
12if versionscript
13libasn1_la_LDFLAGS += $(LDFLAGS_VERSION_SCRIPT)$(srcdir)/version-script.map
14endif
15
16
17libasn1_la_LIBADD = \
18	libasn1base.la \
19	@LIB_com_err@ \
20	$(LIBADD_roken)
21
22BUILT_SOURCES =				\
23	$(gen_files_rfc2459:.x=.c)	\
24	$(gen_files_cms:.x=.c)		\
25	$(gen_files_krb5:.x=.c)		\
26	$(gen_files_pkinit:.x=.c)	\
27	$(gen_files_pkcs8:.x=.c)	\
28	$(gen_files_pkcs9:.x=.c)	\
29	$(gen_files_pkcs12:.x=.c)	\
30	$(gen_files_digest:.x=.c)	\
31	$(gen_files_kx509:.x=.c)
32
33gen_files_krb5 = asn1_krb5_asn1.x
34gen_files_cms = asn1_cms_asn1.x
35gen_files_rfc2459 = asn1_rfc2459_asn1.x
36gen_files_pkinit = asn1_pkinit_asn1.x
37gen_files_pkcs12 = asn1_pkcs12_asn1.x
38gen_files_pkcs8 = asn1_pkcs8_asn1.x
39gen_files_pkcs9 = asn1_pkcs9_asn1.x
40gen_files_test_template = test_template_asn1-template.c
41gen_files_test = asn1_test_asn1.x
42gen_files_digest = asn1_digest_asn1.x
43gen_files_kx509 = asn1_kx509_asn1.x
44
45noinst_PROGRAMS = asn1_gen
46
47libexec_heimdal_PROGRAMS = asn1_compile asn1_print
48
49TESTS = check-der check-gen check-timegm check-ber check-template
50check_PROGRAMS = $(TESTS)
51
52asn1_gen_SOURCES = asn1_gen.c
53asn1_print_SOURCES = asn1_print.c
54check_der_SOURCES = check-der.c check-common.c check-common.h
55
56check_template_SOURCES = check-template.c check-common.c check-common.h
57nodist_check_template_SOURCES = $(gen_files_test_template:.x=.c)
58
59dist_check_gen_SOURCES = check-gen.c check-common.c check-common.h
60nodist_check_gen_SOURCES = $(gen_files_test:.x=.c)
61
62build_HEADERZ = asn1-template.h
63
64asn1_compile_SOURCES = 				\
65	asn1_queue.h				\
66	asn1parse.y				\
67	der.h					\
68	gen.c					\
69	gen_copy.c				\
70	gen_decode.c				\
71	gen_encode.c				\
72	gen_free.c				\
73	gen_glue.c				\
74	gen_length.c				\
75	gen_locl.h				\
76	gen_seq.c				\
77	gen_template.c				\
78	hash.c					\
79	hash.h					\
80	lex.l					\
81	lex.h					\
82	main.c					\
83	asn1-template.h				\
84	symbol.c				\
85	symbol.h
86
87dist_libasn1base_la_SOURCES =			\
88	der_locl.h 				\
89	der.c					\
90	der.h					\
91	der_get.c				\
92	der_put.c				\
93	der_free.c				\
94	der_length.c				\
95	der_copy.c				\
96	der_cmp.c				\
97	der_format.c				\
98	heim_asn1.h				\
99	extra.c					\
100	template.c				\
101	timegm.c
102
103nodist_libasn1base_la_SOURCES = 	\
104	asn1_err.h			\
105	asn1_err.c
106
107nodist_libasn1_la_SOURCES = $(BUILT_SOURCES)
108
109asn1_compile_LDADD = \
110	$(LIB_roken) $(LEXLIB)
111
112check_der_LDADD = \
113	libasn1base.la \
114	$(LIB_roken)
115
116check_template_LDADD = $(check_der_LDADD)
117asn1_print_LDADD = $(check_der_LDADD) $(LIB_com_err)
118asn1_gen_LDADD = $(check_der_LDADD)
119check_timegm_LDADD = $(check_der_LDADD)
120
121check_gen_LDADD = \
122	libasn1.la \
123	$(LIB_roken)
124
125check_ber_LDADD = $(check_gen_LDADD)
126
127CLEANFILES = \
128	$(BUILT_SOURCES) \
129	$(gen_files_rfc2459) \
130	$(gen_files_cms) \
131	$(gen_files_krb5) \
132	$(gen_files_pkinit) \
133	$(gen_files_pkcs8) \
134	$(gen_files_pkcs9) \
135	$(gen_files_pkcs12) \
136	$(gen_files_digest) \
137	$(gen_files_kx509) \
138	$(gen_files_test_template) \
139	$(gen_files_test) $(nodist_check_gen_SOURCES) \
140	asn1_err.c asn1_err.h \
141	rfc2459_asn1_files rfc2459_asn1*.h* \
142	cms_asn1_files cms_asn1*.h* \
143	krb5_asn1_files krb5_asn1*.h* \
144	pkinit_asn1_files pkinit_asn1*.h* \
145	pkcs8_asn1_files pkcs8_asn1*.h* \
146	pkcs9_asn1_files pkcs9_asn1*.h* \
147	pkcs12_asn1_files pkcs12_asn1*.h* \
148	digest_asn1_files digest_asn1*.h* \
149	kx509_asn1_files kx509_asn1*.h* \
150	test_template_asn1_files test_template_asn1*.h* \
151	test_asn1_files test_asn1*.h*
152
153dist_include_HEADERS = der.h heim_asn1.h der-protos.h der-private.h
154dist_include_HEADERS += asn1-common.h
155
156nodist_include_HEADERS = asn1_err.h
157nodist_include_HEADERS += krb5_asn1.h
158nodist_include_HEADERS += pkinit_asn1.h
159nodist_include_HEADERS += cms_asn1.h
160nodist_include_HEADERS += rfc2459_asn1.h
161nodist_include_HEADERS += pkcs8_asn1.h
162nodist_include_HEADERS += pkcs9_asn1.h
163nodist_include_HEADERS += pkcs12_asn1.h
164nodist_include_HEADERS += digest_asn1.h
165nodist_include_HEADERS += kx509_asn1.h
166
167priv_headers  = krb5_asn1-priv.h
168priv_headers += pkinit_asn1-priv.h
169priv_headers += cms_asn1-priv.h
170priv_headers += rfc2459_asn1-priv.h
171priv_headers += pkcs8_asn1-priv.h
172priv_headers += pkcs9_asn1-priv.h
173priv_headers += pkcs12_asn1-priv.h
174priv_headers += digest_asn1-priv.h
175priv_headers += kx509_asn1-priv.h
176priv_headers += test_template_asn1.h test_template_asn1-priv.h
177priv_headers += test_asn1.h test_asn1-priv.h
178
179
180
181$(asn1_compile_OBJECTS): asn1parse.h asn1parse.c $(srcdir)/der-protos.h $(srcdir)/der-private.h
182$(libasn1_la_OBJECTS): $(nodist_include_HEADERS) $(priv_headers) asn1_err.h $(srcdir)/der-protos.h $(srcdir)/der-private.h
183$(libasn1base_la_OBJECTS): asn1_err.h $(srcdir)/der-protos.h $(srcdir)/der-private.h
184$(check_gen_OBJECTS): test_asn1.h
185$(check_template_OBJECTS): test_template_asn1.h test_template_asn1_files
186$(asn1_print_OBJECTS): krb5_asn1.h
187
188asn1parse.h: asn1parse.c
189
190$(gen_files_krb5) krb5_asn1.hx krb5_asn1-priv.hx: krb5_asn1_files
191$(gen_files_pkinit) pkinit_asn1.hx pkinit_asn1-priv.hx: pkinit_asn1_files
192$(gen_files_pkcs8) pkcs8_asn1.hx pkcs8_asn1-priv.hx: pkcs8_asn1_files
193$(gen_files_pkcs9) pkcs9_asn1.hx pkcs9_asn1-priv.hx: pkcs9_asn1_files
194$(gen_files_pkcs12) pkcs12_asn1.hx pkcs12_asn1-priv.hx: pkcs12_asn1_files
195$(gen_files_digest) digest_asn1.hx digest_asn1-priv.hx: digest_asn1_files
196$(gen_files_kx509) kx509_asn1.hx kx509_asn1-priv.hx: kx509_asn1_files
197$(gen_files_rfc2459) rfc2459_asn1.hx rfc2459_asn1-priv.hx: rfc2459_asn1_files
198$(gen_files_cms) cms_asn1.hx cms_asn1-priv.hx: cms_asn1_files
199$(gen_files_test_template) test_template_asn1.hx test_template_asn1-priv.hx: test_template_asn1_files
200$(gen_files_test) test_asn1.hx test_asn1-priv.hx: test_asn1_files
201
202rfc2459_asn1_files: asn1_compile$(EXEEXT) $(srcdir)/rfc2459.asn1
203	$(ASN1_COMPILE) --one-code-file --preserve-binary=TBSCertificate --preserve-binary=TBSCRLCertList --preserve-binary=Name --sequence=GeneralNames --sequence=Extensions --sequence=CRLDistributionPoints $(srcdir)/rfc2459.asn1 rfc2459_asn1 || (rm -f rfc2459_asn1_files ; exit 1)
204
205cms_asn1_files: asn1_compile$(EXEEXT) $(srcdir)/cms.asn1 $(srcdir)/cms.opt
206	$(ASN1_COMPILE) --one-code-file --option-file=$(srcdir)/cms.opt $(srcdir)/cms.asn1 cms_asn1 || (rm -f cms_asn1_files ; exit 1)
207
208krb5_asn1_files: asn1_compile$(EXEEXT) $(srcdir)/krb5.asn1 $(srcdir)/krb5.opt
209	$(ASN1_COMPILE) --one-code-file --option-file=$(srcdir)/krb5.opt $(srcdir)/krb5.asn1 krb5_asn1 || (rm -f krb5_asn1_files ; exit 1)
210
211pkinit_asn1_files: asn1_compile$(EXEEXT) $(srcdir)/pkinit.asn1
212	$(ASN1_COMPILE) --one-code-file $(srcdir)/pkinit.asn1 pkinit_asn1 || (rm -f pkinit_asn1_files ; exit 1)
213
214pkcs8_asn1_files: asn1_compile$(EXEEXT) $(srcdir)/pkcs8.asn1
215	$(ASN1_COMPILE) --one-code-file $(srcdir)/pkcs8.asn1 pkcs8_asn1 || (rm -f pkcs8_asn1_files ; exit 1)
216
217pkcs9_asn1_files: asn1_compile$(EXEEXT) $(srcdir)/pkcs9.asn1
218	$(ASN1_COMPILE) --one-code-file $(srcdir)/pkcs9.asn1 pkcs9_asn1 || (rm -f pkcs9_asn1_files ; exit 1)
219
220pkcs12_asn1_files: asn1_compile$(EXEEXT) $(srcdir)/pkcs12.asn1
221	$(ASN1_COMPILE) --one-code-file $(srcdir)/pkcs12.asn1 pkcs12_asn1 || (rm -f pkcs12_asn1_files ; exit 1)
222
223digest_asn1_files: asn1_compile$(EXEEXT) $(srcdir)/digest.asn1
224	$(ASN1_COMPILE) --one-code-file $(srcdir)/digest.asn1 digest_asn1 || (rm -f digest_asn1_files ; exit 1)
225
226kx509_asn1_files: asn1_compile$(EXEEXT) $(srcdir)/kx509.asn1
227	$(ASN1_COMPILE) --one-code-file $(srcdir)/kx509.asn1 kx509_asn1 || (rm -f kx509_asn1_files ; exit 1)
228
229test_template_asn1_files: asn1_compile$(EXEEXT) $(srcdir)/test.asn1
230	$(ASN1_COMPILE) --template --sequence=TESTSeqOf $(srcdir)/test.asn1 test_template_asn1 || (rm -f test_template_asn1_files ; exit 1)
231
232test_asn1_files: asn1_compile$(EXEEXT) $(srcdir)/test.asn1
233	$(ASN1_COMPILE) --one-code-file --sequence=TESTSeqOf $(srcdir)/test.asn1 test_asn1 || (rm -f test_asn1_files ; exit 1)
234
235
236EXTRA_DIST =		\
237	NTMakefile	\
238	asn1_compile-version.rc \
239	libasn1-exports.def \
240	cms.asn1	\
241	cms.opt		\
242	asn1_err.et	\
243	canthandle.asn1	\
244	digest.asn1	\
245	krb5.asn1	\
246	krb5.opt	\
247	kx509.asn1	\
248	pkcs12.asn1	\
249	pkcs8.asn1	\
250	pkcs9.asn1	\
251	pkinit.asn1	\
252	rfc2459.asn1	\
253	setchgpw2.asn1	\
254	test.asn1	\
255	test.gen	\
256	version-script.map
257
258$(srcdir)/der-protos.h:
259	cd $(srcdir) && perl ../../cf/make-proto.pl -q -P comment -o der-protos.h $(dist_libasn1base_la_SOURCES) || rm -f der-protos.h
260
261$(srcdir)/der-private.h:
262	cd $(srcdir) && perl ../../cf/make-proto.pl -q -P comment -p der-private.h $(dist_libasn1base_la_SOURCES) || rm -f der-private.h
263