xref: /netbsd-src/crypto/external/bsd/heimdal/dist/lib/hcrypto/Makefile.am (revision 782713e6c126f1866c6d9cfdee4ceb49483b5828)
1# Id
2
3include $(top_srcdir)/Makefile.am.common
4
5AUTOMAKE_OPTIONS = subdir-objects
6
7if HAVE_HCRYPTO_W_OPENSSL
8AM_CPPFLAGS += $(INCLUDE_openssl_crypto)
9endif
10
11AM_CPPFLAGS += -I$(top_srcdir)/lib/hx509 \
12	       -I$(srcdir)/libtommath -DUSE_HCRYPTO_LTM=1
13
14lib_LTLIBRARIES = libhcrypto.la
15check_LTLIBRARIES = libhctest.la
16
17libhcrypto_la_LDFLAGS = -version-info 5:0:1
18libhcrypto_la_LIBADD = \
19	$(top_builddir)/lib/asn1/libasn1.la \
20	$(LIB_dlopen) \
21	$(LIB_heimbase) \
22	$(LIBADD_roken)
23
24if HAVE_HCRYPTO_W_OPENSSL
25libhcrypto_la_LIBADD += $(LIB_openssl_crypto)
26endif
27
28hcryptoincludedir = $(includedir)/hcrypto
29buildhcryptoinclude = $(buildinclude)/hcrypto
30
31hcryptoinclude_HEADERS =	\
32	aes.h			\
33	bn.h			\
34	des.h			\
35	dh.h			\
36	dsa.h			\
37	ec.h			\
38	ecdh.h			\
39	ecdsa.h			\
40	engine.h		\
41	evp.h			\
42	evp-hcrypto.h		\
43	evp-cc.h		\
44	evp-openssl.h		\
45	evp-pkcs11.h		\
46	hmac.h			\
47	md2.h			\
48	md4.h			\
49	md5.h			\
50	pkcs12.h		\
51	rand.h			\
52	rc2.h			\
53	rc4.h			\
54	rsa.h			\
55	sha.h			\
56	ui.h			\
57	undef.h
58
59install-build-headers:: $(hcryptoinclude_HEADERS)
60	@foo='$(hcryptoinclude_HEADERS)'; \
61	for f in $$foo; do \
62		f=`basename $$f`; \
63		if test -f "$(srcdir)/$$f"; then file="$(srcdir)/$$f"; \
64		else file="$$f"; fi; \
65		if cmp -s  $$file $(buildhcryptoinclude)/$$f 2> /dev/null ; then \
66		: ; else \
67			echo "cp $$file $(buildhcryptoinclude)/$$f";\
68			cp $$file $(buildhcryptoinclude)/$$f; \
69		fi ; \
70	done
71
72PROGRAM_TESTS = \
73	destest \
74	mdtest \
75	rc2test  \
76	rctest \
77	test_bn \
78	test_bulk \
79	test_cipher \
80	test_engine_dso \
81	test_hmac \
82	test_pkcs12 \
83	test_pkcs5
84
85libhctest_la_SOURCES = \
86	des-tables.h	\
87	des.c		\
88	des.h		\
89	ui.c		\
90	ui.h
91
92destest_LDADD = libhctest.la $(LIB_roken)
93
94SCRIPT_TESTS = \
95	test_crypto
96
97noinst_PROGRAMS = test_rand
98
99check_PROGRAMS = $(PROGRAM_TESTS) test_rsa test_dh example_evp_cipher
100check_SCRIPTS = $(SCRIPT_TESTS)
101
102TESTS = $(PROGRAM_TESTS) $(SCRIPT_TESTS)
103
104LDADD = $(lib_LTLIBRARIES) $(LIB_roken) $(LIB_openssl_crypto)
105test_rand_LDADD = $(LDADD) -lm
106
107libhcrypto_la_SOURCES =	\
108	$(ltmsources)	\
109	aes.c		\
110	aes.h		\
111	bn.c		\
112	bn.h		\
113	common.c	\
114	common.h	\
115	camellia.h	\
116	camellia.c	\
117	camellia-ntt.c	\
118	camellia-ntt.h	\
119	des-tables.h	\
120	des.c		\
121	des.h		\
122	dh.c		\
123	dh.h		\
124	dh-ltm.c	\
125	dsa.c		\
126	dsa.h		\
127	doxygen.c	\
128	evp.c		\
129	evp.h		\
130	evp-hcrypto.c	\
131	evp-cc.c	\
132	evp-openssl.c	\
133	evp-pkcs11.c	\
134	engine.c	\
135	engine.h	\
136	hash.h		\
137	hmac.c		\
138	hmac.h		\
139	md2.c		\
140	md2.h		\
141	md4.c		\
142	md4.h		\
143	md5.c		\
144	md5.h		\
145	pkcs5.c		\
146	pkcs12.c	\
147	rand-fortuna.c	\
148	rand-timer.c	\
149	rand-unix.c	\
150	rand.c		\
151	rand.h		\
152	randi.h		\
153	rc2.c		\
154	rc2.h		\
155	rc4.c		\
156	rc4.h		\
157	rijndael-alg-fst.c \
158	rijndael-alg-fst.h \
159	rnd_keys.c	\
160	rsa.c		\
161	rsa-gmp.c	\
162	rsa-ltm.c	\
163	rsa.h		\
164	sha.c		\
165	sha.h		\
166	sha256.c	\
167	sha512.c	\
168	validate.c	\
169	ui.c		\
170	ui.h		\
171	undef.h
172
173ltmsources = \
174	libtommath/tommath.h \
175	libtommath/tommath_class.h \
176	libtommath/tommath_superclass.h \
177	libtommath/bncore.c \
178	libtommath/bn_mp_init.c \
179	libtommath/bn_mp_clear.c \
180	libtommath/bn_mp_exch.c \
181	libtommath/bn_mp_grow.c \
182	libtommath/bn_mp_shrink.c \
183	libtommath/bn_mp_clamp.c \
184	libtommath/bn_mp_zero.c \
185	libtommath/bn_mp_zero_multi.c \
186	libtommath/bn_mp_set.c \
187	libtommath/bn_mp_set_int.c \
188	libtommath/bn_mp_init_size.c \
189	libtommath/bn_mp_copy.c \
190	libtommath/bn_mp_init_copy.c \
191	libtommath/bn_mp_abs.c \
192	libtommath/bn_mp_neg.c \
193	libtommath/bn_mp_cmp_mag.c \
194	libtommath/bn_mp_cmp.c \
195	libtommath/bn_mp_cmp_d.c \
196	libtommath/bn_mp_rshd.c \
197	libtommath/bn_mp_lshd.c \
198	libtommath/bn_mp_mod_2d.c \
199	libtommath/bn_mp_div_2d.c \
200	libtommath/bn_mp_mul_2d.c \
201	libtommath/bn_mp_div_2.c \
202	libtommath/bn_mp_mul_2.c \
203	libtommath/bn_s_mp_add.c \
204	libtommath/bn_s_mp_sub.c \
205	libtommath/bn_fast_s_mp_mul_digs.c \
206	libtommath/bn_s_mp_mul_digs.c \
207	libtommath/bn_fast_s_mp_mul_high_digs.c \
208	libtommath/bn_s_mp_mul_high_digs.c \
209	libtommath/bn_fast_s_mp_sqr.c \
210	libtommath/bn_s_mp_sqr.c \
211	libtommath/bn_mp_add.c \
212	libtommath/bn_mp_sub.c \
213	libtommath/bn_mp_karatsuba_mul.c \
214	libtommath/bn_mp_mul.c \
215	libtommath/bn_mp_karatsuba_sqr.c \
216	libtommath/bn_mp_sqr.c \
217	libtommath/bn_mp_div.c \
218	libtommath/bn_mp_mod.c \
219	libtommath/bn_mp_add_d.c \
220	libtommath/bn_mp_sub_d.c \
221	libtommath/bn_mp_mul_d.c \
222	libtommath/bn_mp_div_d.c \
223	libtommath/bn_mp_mod_d.c \
224	libtommath/bn_mp_expt_d.c \
225	libtommath/bn_mp_addmod.c \
226	libtommath/bn_mp_submod.c \
227	libtommath/bn_mp_mulmod.c \
228	libtommath/bn_mp_sqrmod.c \
229	libtommath/bn_mp_gcd.c \
230	libtommath/bn_mp_lcm.c \
231	libtommath/bn_fast_mp_invmod.c \
232	libtommath/bn_mp_invmod.c \
233	libtommath/bn_mp_reduce.c \
234	libtommath/bn_mp_montgomery_setup.c \
235	libtommath/bn_fast_mp_montgomery_reduce.c \
236	libtommath/bn_mp_montgomery_reduce.c \
237	libtommath/bn_mp_exptmod_fast.c \
238	libtommath/bn_mp_exptmod.c \
239	libtommath/bn_mp_2expt.c \
240	libtommath/bn_mp_n_root.c \
241	libtommath/bn_mp_jacobi.c \
242	libtommath/bn_reverse.c \
243	libtommath/bn_mp_count_bits.c \
244	libtommath/bn_mp_read_unsigned_bin.c \
245	libtommath/bn_mp_read_signed_bin.c \
246	libtommath/bn_mp_to_unsigned_bin.c \
247	libtommath/bn_mp_to_signed_bin.c \
248	libtommath/bn_mp_unsigned_bin_size.c \
249	libtommath/bn_mp_signed_bin_size.c \
250	libtommath/bn_mp_xor.c \
251	libtommath/bn_mp_and.c \
252	libtommath/bn_mp_or.c \
253	libtommath/bn_mp_rand.c \
254	libtommath/bn_mp_montgomery_calc_normalization.c \
255	libtommath/bn_mp_prime_is_divisible.c \
256	libtommath/bn_prime_tab.c \
257	libtommath/bn_mp_prime_fermat.c \
258	libtommath/bn_mp_prime_miller_rabin.c \
259	libtommath/bn_mp_prime_is_prime.c \
260	libtommath/bn_mp_prime_next_prime.c \
261	libtommath/bn_mp_find_prime.c \
262	libtommath/bn_mp_dr_reduce.c \
263	libtommath/bn_mp_dr_is_modulus.c \
264	libtommath/bn_mp_dr_setup.c \
265	libtommath/bn_mp_reduce_setup.c \
266	libtommath/bn_mp_toom_mul.c \
267	libtommath/bn_mp_toom_sqr.c \
268	libtommath/bn_mp_div_3.c \
269	libtommath/bn_s_mp_exptmod.c \
270	libtommath/bn_mp_reduce_2k.c \
271	libtommath/bn_mp_reduce_is_2k.c \
272	libtommath/bn_mp_reduce_2k_setup.c \
273	libtommath/bn_mp_reduce_2k_l.c \
274	libtommath/bn_mp_reduce_is_2k_l.c \
275	libtommath/bn_mp_reduce_2k_setup_l.c \
276	libtommath/bn_mp_radix_smap.c \
277	libtommath/bn_mp_read_radix.c \
278	libtommath/bn_mp_toradix.c \
279	libtommath/bn_mp_radix_size.c \
280	libtommath/bn_mp_fread.c \
281	libtommath/bn_mp_fwrite.c \
282	libtommath/bn_mp_cnt_lsb.c \
283	libtommath/bn_error.c \
284	libtommath/bn_mp_init_multi.c \
285	libtommath/bn_mp_clear_multi.c \
286	libtommath/bn_mp_exteuclid.c \
287	libtommath/bn_mp_toradix_n.c \
288	libtommath/bn_mp_prime_random_ex.c \
289	libtommath/bn_mp_get_int.c \
290	libtommath/bn_mp_sqrt.c \
291	libtommath/bn_mp_is_square.c \
292	libtommath/bn_mp_init_set.c \
293	libtommath/bn_mp_init_set_int.c \
294	libtommath/bn_mp_invmod_slow.c \
295	libtommath/bn_mp_prime_rabin_miller_trials.c \
296	libtommath/bn_mp_to_signed_bin_n.c \
297	libtommath/bn_mp_to_unsigned_bin_n.c
298
299
300$(libhcrypto_la_OBJECTS): hcrypto-link
301
302libhcrypto_la_CPPFLAGS = -DBUILD_HCRYPTO_LIB $(AM_CPPFLAGS)
303
304if versionscript
305libhcrypto_la_LDFLAGS += $(LDFLAGS_VERSION_SCRIPT)$(srcdir)/version-script.map
306endif
307$(libhcrypto_la_OBJECTS): $(srcdir)/version-script.map
308
309
310hcrypto-link:
311	$(LN_S) $(srcdir)/../hcrypto hcrypto
312	touch hcrypto-link
313
314do_subst = sed -e 's,[@]srcdir[@],$(srcdir),g' -e 's,[@]exeext[@],$(exeext),g'
315
316test_crypto: test_crypto.in Makefile
317	$(do_subst) < $(srcdir)/test_crypto.in > test_crypto.tmp
318	chmod +x test_crypto.tmp
319	mv test_crypto.tmp test_crypto
320
321CLEANFILES = \
322	crypto-test \
323	crypto-test2 \
324	error \
325	hcrypto \
326	hcrypto-link \
327	test.file \
328	test_crypto \
329	test-out* \
330	test_crypto.tmp \
331	test_crypto.tmp
332
333EXTRA_DIST = \
334	NTMakefile \
335	DESperate.txt \
336	passwd_dialog.rc \
337	libhcrypto-exports.def \
338	dh-tfm.c \
339	ec.h \
340	ecdh.h \
341	ecdsa.h \
342	evp-crypt.c \
343	evp-w32.c \
344	evp-w32.h \
345	evp-wincng.c \
346	evp-wincng.h \
347	gen-des.pl \
348	md5crypt_test.c \
349	passwd_dialog.aps \
350	passwd_dialog.clw \
351	passwd_dialog.rc \
352	passwd_dialog.res \
353	passwd_dlg.c \
354	passwd_dlg.h \
355	rand-w32.c \
356	resource.h \
357	rsa-tfm.c \
358	rsakey.der \
359	rsakey2048.der \
360	rsakey4096.der \
361	test_crypto.in \
362	version-script.map
363