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