Windows: Fix build rules and includes for libtommath
[heimdal.git] / lib / hx509 / Makefile.am
blob8f052c9e7de6bbe4e9a284606546048416d0b35f
1 include $(top_srcdir)/Makefile.am.common
3 lib_LTLIBRARIES = libhx509.la
4 libhx509_la_LDFLAGS = -version-info 5:0:0
6 BUILT_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
13 gen_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
33 gen_files_pkcs10 =                      \
34         asn1_CertificationRequestInfo.x \
35         asn1_CertificationRequest.x
37 gen_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        
52 AM_YFLAGS = -d
54 dist_libhx509_la_SOURCES = \
55         ca.c \
56         cert.c \
57         cms.c \
58         collector.c \
59         crypto.c \
60         doxygen.c \
61         error.c \
62         env.c \
63         file.c \
64         hx509-private.h \
65         hx509-protos.h \
66         hx509.h \
67         hx_locl.h \
68         sel.c \
69         sel.h \
70         sel-gram.y \
71         sel-lex.l \
72         keyset.c \
73         ks_dir.c \
74         ks_file.c \
75         ks_mem.c \
76         ks_null.c \
77         ks_p11.c \
78         ks_p12.c \
79         ks_keychain.c \
80         lock.c \
81         name.c \
82         peer.c \
83         print.c \
84         softp11.c \
85         ref/pkcs11.h \
86         req.c \
87         revoke.c
89 sel-lex.c: sel-gram.h
91 libhx509_la_LIBADD = \
92         $(LIB_com_err) \
93         $(LIB_hcrypto) \
94         $(top_builddir)/lib/asn1/libasn1.la \
95         $(top_builddir)/lib/wind/libwind.la \
96         $(LIBADD_roken) \
97         $(LIB_dlopen)
99 if FRAMEWORK_SECURITY
100 libhx509_la_LDFLAGS += -framework Security -framework CoreFoundation
101 endif
103 if versionscript
104 libhx509_la_LDFLAGS += $(LDFLAGS_VERSION_SCRIPT)$(srcdir)/version-script.map
105 endif
106 $(libhx509_la_OBJECTS): $(srcdir)/version-script.map $(nodist_include_HEADERS) $(priv_headers)
108 libhx509_la_CPPFLAGS = -I$(srcdir)/ref $(INCLUDE_hcrypto)
109 nodist_libhx509_la_SOURCES = $(BUILT_SOURCES)
111 $(gen_files_ocsp) ocsp_asn1.hx ocsp_asn1-priv.hx: ocsp_asn1_files
112 $(gen_files_pkcs10) pkcs10_asn1.hx pkcs10_asn1-priv.hx: pkcs10_asn1_files
113 $(gen_files_crmf) crmf_asn1.hx crmf_asn1-priv.hx: crmf_asn1_files
115 dist_include_HEADERS = hx509.h hx509-protos.h
117 nodist_include_HEADERS = hx509_err.h
118 nodist_include_HEADERS += ocsp_asn1.h
119 nodist_include_HEADERS += pkcs10_asn1.h
120 nodist_include_HEADERS += crmf_asn1.h
122 priv_headers  = ocsp_asn1-priv.h
123 priv_headers += pkcs10_asn1-priv.h
124 priv_headers += crmf_asn1-priv.h
127 ocsp_asn1_files: $(ASN1_COMPILE_DEP) $(srcdir)/ocsp.asn1 $(srcdir)/ocsp.opt
128         $(ASN1_COMPILE) --option-file=$(srcdir)/ocsp.opt $(srcdir)/ocsp.asn1 ocsp_asn1 || (rm -f ocsp_asn1_files ; exit 1)
130 pkcs10_asn1_files: $(ASN1_COMPILE_DEP) $(srcdir)/pkcs10.asn1 $(srcdir)/pkcs10.opt
131         $(ASN1_COMPILE) --option-file=$(srcdir)/pkcs10.opt $(srcdir)/pkcs10.asn1 pkcs10_asn1 || (rm -f pkcs10_asn1_files ; exit 1)
133 crmf_asn1_files: $(ASN1_COMPILE_DEP) $(srcdir)/crmf.asn1
134         $(ASN1_COMPILE) $(srcdir)/crmf.asn1 crmf_asn1 || (rm -f crmf_asn1_files ; exit 1)
136 $(libhx509_la_OBJECTS): $(srcdir)/hx509-protos.h $(srcdir)/hx509-private.h $(srcdir)/hx_locl.h
137 $(libhx509_la_OBJECTS): ocsp_asn1.h pkcs10_asn1.h
139 $(srcdir)/hx509-protos.h:
140         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
142 $(srcdir)/hx509-private.h:
143         cd $(srcdir) && perl ../../cf/make-proto.pl -q -P comment -p hx509-private.h $(dist_libhx509_la_SOURCES) || rm -f hx509-private.h
145 bin_PROGRAMS = hxtool
147 hxtool-commands.c hxtool-commands.h: hxtool-commands.in $(SLC)
148         $(SLC) $(srcdir)/hxtool-commands.in
150 dist_hxtool_SOURCES = hxtool.c
151 nodist_hxtool_SOURCES = hxtool-commands.c hxtool-commands.h
153 $(hxtool_OBJECTS): hxtool-commands.h
155 hxtool_CPPFLAGS = $(INCLUDE_hcrypto)
156 hxtool_LDADD = \
157         libhx509.la \
158         $(top_builddir)/lib/asn1/libasn1.la \
159         $(LIB_hcrypto) \
160         $(LIB_roken) \
161         $(top_builddir)/lib/sl/libsl.la
163 CLEANFILES = $(BUILT_SOURCES) sel-gram.c sel-lex.c \
164         $(gen_files_ocsp) ocsp_asn1_files ocsp_asn1{,-priv}.h* \
165         ocsp_asn1-template.[ch]* \
166         $(gen_files_pkcs10) pkcs10_asn1_files pkcs10_asn1{,-priv}.h* \
167         pkcs10_asn1-template.[ch]* \
168         $(gen_files_crmf) crmf_asn1_files crmf_asn1{,-priv}.h* \
169         crmf_asn1-template.[ch]* \
170         $(TESTS) \
171         hxtool-commands.c hxtool-commands.h *.tmp \
172         request.out \
173         out.pem out2.pem \
174         sd sd.pem \
175         sd.data sd.data.out \
176         ev.data ev.data.out \
177         cert-null.pem cert-sub-ca2.pem \
178         cert-ee.pem cert-ca.pem \
179         cert-sub-ee.pem cert-sub-ca.pem \
180         cert-proxy.der cert-ca.der cert-ee.der pkcs10-request.der \
181         wca.pem wuser.pem wdc.pem wcrl.crl \
182         random-data statfile crl.crl \
183         test p11dbg.log pkcs11.cfg \
184         test-rc-file.rc
186 clean-local:
187         @echo "cleaning PKITS" ; rm -rf PKITS_data
190 # regression tests
193 check_SCRIPTS = $(SCRIPT_TESTS)
194 check_PROGRAMS = $(PROGRAM_TESTS) test_soft_pkcs11
196 LDADD = libhx509.la
198 test_soft_pkcs11_LDADD = libhx509.la
199 test_soft_pkcs11_CPPFLAGS = -I$(srcdir)/ref
201 TESTS = $(SCRIPT_TESTS) $(PROGRAM_TESTS)
203 PROGRAM_TESTS =                 \
204         test_name               \
205         test_expr
207 SCRIPT_TESTS =                  \
208         test_ca                 \
209         test_cert               \
210         test_chain              \
211         test_cms                \
212         test_crypto             \
213         test_nist               \
214         test_nist2              \
215         test_pkcs11             \
216         test_java_pkcs11        \
217         test_nist_cert          \
218         test_nist_pkcs12        \
219         test_req                \
220         test_windows            \
221         test_query
223 do_subst = sed -e 's,[@]srcdir[@],$(srcdir),g' \
224         -e 's,[@]objdir[@],$(top_builddir)/lib/hx509,g' \
225         -e 's,[@]egrep[@],$(EGREP),g'
227 test_ca: test_ca.in Makefile
228         $(do_subst) < $(srcdir)/test_ca.in > test_ca.tmp
229         chmod +x test_ca.tmp
230         mv test_ca.tmp test_ca
232 test_cert: test_cert.in Makefile
233         $(do_subst) < $(srcdir)/test_cert.in > test_cert.tmp
234         chmod +x test_cert.tmp
235         mv test_cert.tmp test_cert
237 test_chain: test_chain.in Makefile
238         $(do_subst) < $(srcdir)/test_chain.in > test_chain.tmp
239         chmod +x test_chain.tmp
240         mv test_chain.tmp test_chain
242 test_cms: test_cms.in Makefile
243         $(do_subst) < $(srcdir)/test_cms.in > test_cms.tmp
244         chmod +x test_cms.tmp
245         mv test_cms.tmp test_cms
247 test_crypto: test_crypto.in Makefile
248         $(do_subst) < $(srcdir)/test_crypto.in > test_crypto.tmp
249         chmod +x test_crypto.tmp
250         mv test_crypto.tmp test_crypto
252 test_nist: test_nist.in Makefile
253         $(do_subst) < $(srcdir)/test_nist.in > test_nist.tmp
254         chmod +x test_nist.tmp
255         mv test_nist.tmp test_nist
257 test_nist2: test_nist2.in Makefile
258         $(do_subst) < $(srcdir)/test_nist2.in > test_nist2.tmp
259         chmod +x test_nist2.tmp
260         mv test_nist2.tmp test_nist2
262 test_pkcs11: test_pkcs11.in Makefile
263         $(do_subst) < $(srcdir)/test_pkcs11.in > test_pkcs11.tmp
264         chmod +x test_pkcs11.tmp
265         mv test_pkcs11.tmp test_pkcs11
267 test_java_pkcs11: test_java_pkcs11.in Makefile
268         $(do_subst) < $(srcdir)/test_java_pkcs11.in > test_java_pkcs11.tmp
269         chmod +x test_java_pkcs11.tmp
270         mv test_java_pkcs11.tmp test_java_pkcs11
272 test_nist_cert: test_nist_cert.in Makefile
273         $(do_subst) < $(srcdir)/test_nist_cert.in > test_nist_cert.tmp
274         chmod +x test_nist_cert.tmp
275         mv test_nist_cert.tmp test_nist_cert
277 test_nist_pkcs12: test_nist_pkcs12.in Makefile
278         $(do_subst) < $(srcdir)/test_nist_pkcs12.in > test_nist_pkcs12.tmp
279         chmod +x test_nist_pkcs12.tmp
280         mv test_nist_pkcs12.tmp test_nist_pkcs12
282 test_req: test_req.in Makefile
283         $(do_subst) < $(srcdir)/test_req.in > test_req.tmp
284         chmod +x test_req.tmp
285         mv test_req.tmp test_req
287 test_windows: test_windows.in Makefile
288         $(do_subst) < $(srcdir)/test_windows.in > test_windows.tmp
289         chmod +x test_windows.tmp
290         mv test_windows.tmp test_windows
292 test_query: test_query.in Makefile
293         $(do_subst) < $(srcdir)/test_query.in > test_query.tmp
294         chmod +x test_query.tmp
295         mv test_query.tmp test_query
297 EXTRA_DIST = \
298         version-script.map \
299         crmf.asn1 \
300         hx509_err.et \
301         hxtool-commands.in \
302         ocsp.asn1 \
303         pkcs10.asn1 \
304         test_ca.in \
305         test_chain.in \
306         test_cert.in \
307         test_cms.in \
308         test_crypto.in \
309         test_nist.in \
310         test_nist2.in \
311         test_nist_cert.in \
312         test_nist_pkcs12.in \
313         test_pkcs11.in \
314         test_java_pkcs11.in \
315         test_query.in \
316         test_req.in \
317         test_windows.in \
318         tst-crypto-available1 \
319         tst-crypto-available2 \
320         tst-crypto-available3 \
321         tst-crypto-select \
322         tst-crypto-select1 \
323         tst-crypto-select2 \
324         tst-crypto-select3 \
325         tst-crypto-select4 \
326         tst-crypto-select5 \
327         tst-crypto-select6 \
328         tst-crypto-select7 \
329         data/n0ll.pem \
330         data/secp160r1TestCA.cert.pem \
331         data/secp160r1TestCA.key.pem \
332         data/secp160r1TestCA.pem \
333         data/secp160r2TestClient.cert.pem \
334         data/secp160r2TestClient.key.pem \
335         data/secp160r2TestClient.pem \
336         data/secp160r2TestServer.cert.pem \
337         data/secp160r2TestServer.key.pem \
338         data/secp160r2TestServer.pem \
339         data/bleichenbacher-bad.pem \
340         data/bleichenbacher-good.pem \
341         data/bleichenbacher-sf-pad-correct.pem \
342         data/ca.crt \
343         data/ca.key \
344         data/crl1.crl \
345         data/crl1.der \
346         data/gen-req.sh \
347         data/j.pem \
348         data/kdc.crt \
349         data/kdc.key \
350         data/key.der \
351         data/key2.der \
352         data/nist-data \
353         data/nist-data2 \
354         data/no-proxy-test.crt \
355         data/no-proxy-test.key \
356         data/ocsp-req1.der \
357         data/ocsp-req2.der \
358         data/ocsp-resp1-2.der \
359         data/ocsp-resp1-3.der \
360         data/ocsp-resp1-ca.der \
361         data/ocsp-resp1-keyhash.der \
362         data/ocsp-resp1-ocsp-no-cert.der \
363         data/ocsp-resp1-ocsp.der \
364         data/ocsp-resp1.der \
365         data/ocsp-resp2.der \
366         data/ocsp-responder.crt \
367         data/ocsp-responder.key \
368         data/openssl.cnf \
369         data/pkinit-proxy-chain.crt \
370         data/pkinit-proxy.crt \
371         data/pkinit-proxy.key \
372         data/pkinit-pw.key \
373         data/pkinit.crt \
374         data/pkinit.key \
375         data/pkinit-ec.crt \
376         data/pkinit-ec.key \
377         data/proxy-level-test.crt \
378         data/proxy-level-test.key \
379         data/proxy-test.crt \
380         data/proxy-test.key \
381         data/proxy10-child-test.crt \
382         data/proxy10-child-test.key \
383         data/proxy10-child-child-test.crt \
384         data/proxy10-child-child-test.key \
385         data/proxy10-test.crt \
386         data/proxy10-test.key \
387         data/revoke.crt \
388         data/revoke.key \
389         data/sf-class2-root.pem \
390         data/static-file \
391         data/sub-ca.crt \
392         data/sub-ca.key \
393         data/sub-cert.crt \
394         data/sub-cert.key \
395         data/sub-cert.p12 \
396         data/test-ds-only.crt \
397         data/test-ds-only.key \
398         data/test-enveloped-aes-128 \
399         data/test-enveloped-aes-256 \
400         data/test-enveloped-des \
401         data/test-enveloped-des-ede3 \
402         data/test-enveloped-rc2-128 \
403         data/test-enveloped-rc2-40 \
404         data/test-enveloped-rc2-64 \
405         data/test-ke-only.crt \
406         data/test-ke-only.key \
407         data/test-nopw.p12 \
408         data/test-pw.key \
409         data/test-signed-data \
410         data/test-signed-data-noattr \
411         data/test-signed-data-noattr-nocerts \
412         data/test-signed-sha-1 \
413         data/test-signed-sha-256 \
414         data/test-signed-sha-512 \
415         data/test.combined.crt \
416         data/test.crt \
417         data/test.key \
418         data/test.p12 \
419         data/yutaka-pad-broken-ca.pem \
420         data/yutaka-pad-broken-cert.pem \
421         data/yutaka-pad-ok-ca.pem \
422         data/yutaka-pad-ok-cert.pem \
423         data/yutaka-pad.key