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