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