xref: /freebsd/crypto/heimdal/lib/hx509/Makefile.am (revision 3078531de10dcae44b253a35125c949ff4235284)
1include $(top_srcdir)/Makefile.am.common
2
3lib_LTLIBRARIES = libhx509.la
4libhx509_la_LDFLAGS = -version-info 5:0:0
5
6BUILT_SOURCES =				\
7	sel-gram.h			\
8	$(gen_files_ocsp:.x=.c)		\
9	$(gen_files_pkcs10:.x=.c)	\
10	hx509_err.c			\
11	hx509_err.h
12
13gen_files_ocsp = 			\
14	asn1_OCSPBasicOCSPResponse.x	\
15	asn1_OCSPCertID.x		\
16	asn1_OCSPCertStatus.x		\
17	asn1_OCSPInnerRequest.x		\
18	asn1_OCSPKeyHash.x		\
19	asn1_OCSPRequest.x		\
20	asn1_OCSPResponderID.x		\
21	asn1_OCSPResponse.x		\
22	asn1_OCSPResponseBytes.x	\
23	asn1_OCSPResponseData.x		\
24	asn1_OCSPResponseStatus.x	\
25	asn1_OCSPSignature.x		\
26	asn1_OCSPSingleResponse.x	\
27	asn1_OCSPTBSRequest.x		\
28	asn1_OCSPVersion.x		\
29	asn1_id_pkix_ocsp.x		\
30	asn1_id_pkix_ocsp_basic.x	\
31	asn1_id_pkix_ocsp_nonce.x
32
33gen_files_pkcs10 = 			\
34	asn1_CertificationRequestInfo.x	\
35	asn1_CertificationRequest.x
36
37gen_files_crmf = 			\
38	asn1_CRMFRDNSequence.x		\
39	asn1_CertReqMessages.x		\
40	asn1_CertReqMsg.x		\
41	asn1_CertRequest.x		\
42	asn1_CertTemplate.x		\
43	asn1_Controls.x			\
44	asn1_PBMParameter.x		\
45	asn1_PKMACValue.x		\
46	asn1_POPOPrivKey.x		\
47	asn1_POPOSigningKey.x		\
48	asn1_POPOSigningKeyInput.x	\
49	asn1_ProofOfPossession.x	\
50	asn1_SubsequentMessage.x
51
52AM_YFLAGS = -d
53
54dist_libhx509_la_SOURCES = \
55	ca.c \
56	cert.c \
57	char_map.h \
58	cms.c \
59	collector.c \
60	crypto.c \
61	doxygen.c \
62	error.c \
63	env.c \
64	file.c \
65	hx509-private.h \
66	hx509-protos.h \
67	hx509.h \
68	hx_locl.h \
69	sel.c \
70	sel.h \
71	sel-gram.y \
72	sel-lex.l \
73	keyset.c \
74	ks_dir.c \
75	ks_file.c \
76	ks_mem.c \
77	ks_null.c \
78	ks_p11.c \
79	ks_p12.c \
80	ks_keychain.c \
81	lock.c \
82	name.c \
83	peer.c \
84	print.c \
85	softp11.c \
86	ref/pkcs11.h \
87	req.c \
88	revoke.c
89
90sel-lex.c: sel-gram.h
91
92libhx509_la_DEPENDENCIES = version-script.map
93
94libhx509_la_LIBADD = \
95	$(LIB_com_err) \
96	$(LIB_hcrypto) \
97	$(top_builddir)/lib/asn1/libasn1.la \
98	$(top_builddir)/lib/wind/libwind.la \
99	$(LIBADD_roken) \
100	$(LIB_dlopen)
101
102if FRAMEWORK_SECURITY
103libhx509_la_LDFLAGS += -framework Security -framework CoreFoundation
104endif
105
106if versionscript
107libhx509_la_LDFLAGS += $(LDFLAGS_VERSION_SCRIPT)$(srcdir)/version-script.map
108endif
109$(libhx509_la_OBJECTS): $(srcdir)/version-script.map $(nodist_include_HEADERS) $(priv_headers)
110
111libhx509_la_CPPFLAGS = -I$(srcdir)/ref $(INCLUDE_hcrypto)
112nodist_libhx509_la_SOURCES = $(BUILT_SOURCES)
113
114$(gen_files_ocsp) ocsp_asn1.hx ocsp_asn1-priv.hx: ocsp_asn1_files
115$(gen_files_pkcs10) pkcs10_asn1.hx pkcs10_asn1-priv.hx: pkcs10_asn1_files
116$(gen_files_crmf) crmf_asn1.hx crmf_asn1-priv.hx: crmf_asn1_files
117
118dist_include_HEADERS = hx509.h hx509-protos.h
119
120nodist_include_HEADERS = hx509_err.h
121nodist_include_HEADERS += ocsp_asn1.h
122nodist_include_HEADERS += pkcs10_asn1.h
123nodist_include_HEADERS += crmf_asn1.h
124
125priv_headers  = ocsp_asn1-priv.h
126priv_headers += pkcs10_asn1-priv.h
127priv_headers += crmf_asn1-priv.h
128
129
130ocsp_asn1_files: $(ASN1_COMPILE_DEP) $(srcdir)/ocsp.asn1 $(srcdir)/ocsp.opt
131	$(ASN1_COMPILE) --option-file=$(srcdir)/ocsp.opt $(srcdir)/ocsp.asn1 ocsp_asn1 || (rm -f ocsp_asn1_files ; exit 1)
132
133pkcs10_asn1_files: $(ASN1_COMPILE_DEP) $(srcdir)/pkcs10.asn1 $(srcdir)/pkcs10.opt
134	$(ASN1_COMPILE) --option-file=$(srcdir)/pkcs10.opt $(srcdir)/pkcs10.asn1 pkcs10_asn1 || (rm -f pkcs10_asn1_files ; exit 1)
135
136crmf_asn1_files: $(ASN1_COMPILE_DEP) $(srcdir)/crmf.asn1
137	$(ASN1_COMPILE) $(srcdir)/crmf.asn1 crmf_asn1 || (rm -f crmf_asn1_files ; exit 1)
138
139$(libhx509_la_OBJECTS): $(srcdir)/hx509-protos.h $(srcdir)/hx509-private.h $(srcdir)/hx_locl.h
140$(libhx509_la_OBJECTS): ocsp_asn1.h pkcs10_asn1.h
141
142$(srcdir)/hx509-protos.h:
143	cd $(srcdir) && perl ../../cf/make-proto.pl -R '^(_|^C)' -E HX509_LIB -q -P comment -o hx509-protos.h $(dist_libhx509_la_SOURCES) || rm -f hx509-protos.h
144
145$(srcdir)/hx509-private.h:
146	cd $(srcdir) && perl ../../cf/make-proto.pl -q -P comment -p hx509-private.h $(dist_libhx509_la_SOURCES) || rm -f hx509-private.h
147
148bin_PROGRAMS = hxtool
149
150hxtool-commands.c hxtool-commands.h: hxtool-commands.in $(SLC)
151	$(SLC) $(srcdir)/hxtool-commands.in
152
153dist_hxtool_SOURCES = hxtool.c
154nodist_hxtool_SOURCES = hxtool-commands.c hxtool-commands.h
155
156$(hxtool_OBJECTS): hxtool-commands.h
157
158hxtool_CPPFLAGS = $(INCLUDE_hcrypto)
159hxtool_LDADD = \
160	libhx509.la \
161	$(top_builddir)/lib/asn1/libasn1.la \
162	$(LIB_hcrypto) \
163	$(LIB_roken) \
164	$(top_builddir)/lib/sl/libsl.la
165
166CLEANFILES = $(BUILT_SOURCES) sel-gram.c sel-lex.c \
167	$(gen_files_ocsp) ocsp_asn1_files ocsp_asn1{,-priv}.h* \
168	ocsp_asn1-template.[ch]* \
169	$(gen_files_pkcs10) pkcs10_asn1_files pkcs10_asn1{,-priv}.h* \
170	pkcs10_asn1-template.[ch]* \
171	$(gen_files_crmf) crmf_asn1_files crmf_asn1{,-priv}.h* \
172	crmf_asn1-template.[ch]* \
173	$(TESTS) \
174	hxtool-commands.c hxtool-commands.h *.tmp \
175	request.out \
176	out.pem out2.pem \
177	sd sd.pem \
178	sd.data sd.data.out \
179	ev.data ev.data.out \
180	cert-null.pem cert-sub-ca2.pem \
181	cert-ee.pem cert-ca.pem \
182	cert-sub-ee.pem cert-sub-ca.pem \
183	cert-proxy.der cert-ca.der cert-ee.der pkcs10-request.der \
184	wca.pem wuser.pem wdc.pem wcrl.crl \
185	random-data statfile crl.crl \
186	test p11dbg.log pkcs11.cfg \
187	test-rc-file.rc
188
189clean-local:
190	@echo "cleaning PKITS" ; rm -rf PKITS_data
191
192#
193# regression tests
194#
195
196check_SCRIPTS = $(SCRIPT_TESTS)
197check_PROGRAMS = $(PROGRAM_TESTS) test_soft_pkcs11
198
199LDADD = libhx509.la
200
201test_soft_pkcs11_LDADD = libhx509.la
202test_soft_pkcs11_CPPFLAGS = -I$(srcdir)/ref
203
204test_name_CPPFLAGS = $(INCLUDE_hcrypto)
205test_name_LDADD = libhx509.la $(LIB_roken)
206
207TESTS = $(SCRIPT_TESTS) $(PROGRAM_TESTS)
208
209PROGRAM_TESTS = 		\
210	test_name		\
211	test_expr
212
213SCRIPT_TESTS = 			\
214	test_ca			\
215	test_cert		\
216	test_chain		\
217	test_cms		\
218	test_crypto		\
219	test_nist		\
220	test_nist2		\
221	test_pkcs11		\
222	test_java_pkcs11	\
223	test_nist_cert		\
224	test_nist_pkcs12	\
225	test_req		\
226	test_windows		\
227	test_query
228
229do_subst = sed -e 's,[@]srcdir[@],$(srcdir),g' \
230	-e 's,[@]objdir[@],$(top_builddir)/lib/hx509,g' \
231	-e 's,[@]egrep[@],$(EGREP),g'
232
233test_ca: test_ca.in Makefile
234	$(do_subst) < $(srcdir)/test_ca.in > test_ca.tmp
235	chmod +x test_ca.tmp
236	mv test_ca.tmp test_ca
237
238test_cert: test_cert.in Makefile
239	$(do_subst) < $(srcdir)/test_cert.in > test_cert.tmp
240	chmod +x test_cert.tmp
241	mv test_cert.tmp test_cert
242
243test_chain: test_chain.in Makefile
244	$(do_subst) < $(srcdir)/test_chain.in > test_chain.tmp
245	chmod +x test_chain.tmp
246	mv test_chain.tmp test_chain
247
248test_cms: test_cms.in Makefile
249	$(do_subst) < $(srcdir)/test_cms.in > test_cms.tmp
250	chmod +x test_cms.tmp
251	mv test_cms.tmp test_cms
252
253test_crypto: test_crypto.in Makefile
254	$(do_subst) < $(srcdir)/test_crypto.in > test_crypto.tmp
255	chmod +x test_crypto.tmp
256	mv test_crypto.tmp test_crypto
257
258test_nist: test_nist.in Makefile
259	$(do_subst) < $(srcdir)/test_nist.in > test_nist.tmp
260	chmod +x test_nist.tmp
261	mv test_nist.tmp test_nist
262
263test_nist2: test_nist2.in Makefile
264	$(do_subst) < $(srcdir)/test_nist2.in > test_nist2.tmp
265	chmod +x test_nist2.tmp
266	mv test_nist2.tmp test_nist2
267
268test_pkcs11: test_pkcs11.in Makefile
269	$(do_subst) < $(srcdir)/test_pkcs11.in > test_pkcs11.tmp
270	chmod +x test_pkcs11.tmp
271	mv test_pkcs11.tmp test_pkcs11
272
273test_java_pkcs11: test_java_pkcs11.in Makefile
274	$(do_subst) < $(srcdir)/test_java_pkcs11.in > test_java_pkcs11.tmp
275	chmod +x test_java_pkcs11.tmp
276	mv test_java_pkcs11.tmp test_java_pkcs11
277
278test_nist_cert: test_nist_cert.in Makefile
279	$(do_subst) < $(srcdir)/test_nist_cert.in > test_nist_cert.tmp
280	chmod +x test_nist_cert.tmp
281	mv test_nist_cert.tmp test_nist_cert
282
283test_nist_pkcs12: test_nist_pkcs12.in Makefile
284	$(do_subst) < $(srcdir)/test_nist_pkcs12.in > test_nist_pkcs12.tmp
285	chmod +x test_nist_pkcs12.tmp
286	mv test_nist_pkcs12.tmp test_nist_pkcs12
287
288test_req: test_req.in Makefile
289	$(do_subst) < $(srcdir)/test_req.in > test_req.tmp
290	chmod +x test_req.tmp
291	mv test_req.tmp test_req
292
293test_windows: test_windows.in Makefile
294	$(do_subst) < $(srcdir)/test_windows.in > test_windows.tmp
295	chmod +x test_windows.tmp
296	mv test_windows.tmp test_windows
297
298test_query: test_query.in Makefile
299	$(do_subst) < $(srcdir)/test_query.in > test_query.tmp
300	chmod +x test_query.tmp
301	mv test_query.tmp test_query
302
303EXTRA_DIST = \
304	NTMakefile \
305	hxtool-version.rc \
306	libhx509-exports.def \
307	version-script.map \
308	crmf.asn1 \
309	hx509_err.et \
310	hxtool-commands.in \
311	quote.py \
312	ocsp.asn1 \
313	ocsp.opt \
314	pkcs10.asn1 \
315	pkcs10.opt \
316	test_ca.in \
317	test_chain.in \
318	test_cert.in \
319	test_cms.in \
320	test_crypto.in \
321	test_nist.in \
322	test_nist2.in \
323	test_nist_cert.in \
324	test_nist_pkcs12.in \
325	test_pkcs11.in \
326	test_java_pkcs11.in \
327	test_query.in \
328	test_req.in \
329	test_windows.in \
330	tst-crypto-available1 \
331	tst-crypto-available2 \
332	tst-crypto-available3 \
333	tst-crypto-select \
334	tst-crypto-select1 \
335	tst-crypto-select2 \
336	tst-crypto-select3 \
337	tst-crypto-select4 \
338	tst-crypto-select5 \
339	tst-crypto-select6 \
340	tst-crypto-select7 \
341	data/n0ll.pem \
342	data/secp160r1TestCA.cert.pem \
343	data/secp160r1TestCA.key.pem \
344	data/secp160r1TestCA.pem \
345	data/secp160r2TestClient.cert.pem \
346	data/secp160r2TestClient.key.pem \
347	data/secp160r2TestClient.pem \
348	data/secp160r2TestServer.cert.pem \
349	data/secp160r2TestServer.key.pem \
350	data/secp160r2TestServer.pem \
351	data/bleichenbacher-bad.pem \
352	data/bleichenbacher-good.pem \
353	data/bleichenbacher-sf-pad-correct.pem \
354	data/ca.crt \
355	data/ca.key \
356	data/crl1.crl \
357	data/crl1.der \
358	data/gen-req.sh \
359	data/j.pem \
360	data/kdc.crt \
361	data/kdc.key \
362	data/key.der \
363	data/key2.der \
364	data/nist-data \
365	data/nist-data2 \
366	data/no-proxy-test.crt \
367	data/no-proxy-test.key \
368	data/ocsp-req1.der \
369	data/ocsp-req2.der \
370	data/ocsp-resp1-2.der \
371	data/ocsp-resp1-3.der \
372	data/ocsp-resp1-ca.der \
373	data/ocsp-resp1-keyhash.der \
374	data/ocsp-resp1-ocsp-no-cert.der \
375	data/ocsp-resp1-ocsp.der \
376	data/ocsp-resp1.der \
377	data/ocsp-resp2.der \
378	data/ocsp-responder.crt \
379	data/ocsp-responder.key \
380	data/openssl.cnf \
381	data/pkinit-proxy-chain.crt \
382	data/pkinit-proxy.crt \
383	data/pkinit-proxy.key \
384	data/pkinit-pw.key \
385	data/pkinit.crt \
386	data/pkinit.key \
387	data/pkinit-ec.crt \
388	data/pkinit-ec.key \
389	data/proxy-level-test.crt \
390	data/proxy-level-test.key \
391	data/proxy-test.crt \
392	data/proxy-test.key \
393	data/proxy10-child-test.crt \
394	data/proxy10-child-test.key \
395	data/proxy10-child-child-test.crt \
396	data/proxy10-child-child-test.key \
397	data/proxy10-test.crt \
398	data/proxy10-test.key \
399	data/revoke.crt \
400	data/revoke.key \
401	data/sf-class2-root.pem \
402	data/static-file \
403	data/sub-ca.crt \
404	data/sub-ca.key \
405	data/sub-cert.crt \
406	data/sub-cert.key \
407	data/sub-cert.p12 \
408	data/test-ds-only.crt \
409	data/test-ds-only.key \
410	data/test-enveloped-aes-128 \
411	data/test-enveloped-aes-256 \
412	data/test-enveloped-des \
413	data/test-enveloped-des-ede3 \
414	data/test-enveloped-rc2-128 \
415	data/test-enveloped-rc2-40 \
416	data/test-enveloped-rc2-64 \
417	data/test-ke-only.crt \
418	data/test-ke-only.key \
419	data/test-nopw.p12 \
420	data/test-pw.key \
421	data/test-signed-data \
422	data/test-signed-data-noattr \
423	data/test-signed-data-noattr-nocerts \
424	data/test-signed-sha-1 \
425	data/test-signed-sha-256 \
426	data/test-signed-sha-512 \
427	data/test.combined.crt \
428	data/test.crt \
429	data/test.key \
430	data/test.p12 \
431	data/win-u16-in-printablestring.der \
432	data/yutaka-pad-broken-ca.pem \
433	data/yutaka-pad-broken-cert.pem \
434	data/yutaka-pad-ok-ca.pem \
435	data/yutaka-pad-ok-cert.pem \
436	data/yutaka-pad.key
437