xref: /freebsd/secure/lib/libcrypto/Makefile (revision 262e143bd46171a6415a5b28af260a5efa2a3db8)
1# $FreeBSD$
2
3LIB=		crypto
4SHLIBDIR?=	/lib
5SHLIB_MAJOR=	4
6
7NO_LINT=
8
9.if exists(Makefile.man)
10.include "Makefile.man"
11.endif
12.if defined(NOTYET)
13MAN+=	config.5 des_modes.7
14.endif
15
16.include "Makefile.inc"
17
18# base sources
19SRCS=	cpt_err.c cryptlib.c cversion.c ebcdic.c ex_data.c mem.c mem_clr.c \
20	mem_dbg.c o_time.c o_str.c tmdiff.c uid.c
21INCS=	crypto.h ebcdic.h opensslv.h ossl_typ.h symhacks.h tmdiff.h \
22	../e_os.h ../e_os2.h
23
24# aes
25SRCS+=	aes_cbc.c aes_cfb.c aes_core.c aes_ctr.c aes_ecb.c aes_misc.c aes_ofb.c
26INCS+=	aes.h aes_locl.h
27
28# asn1
29SRCS+=	a_bitstr.c a_bool.c a_bytes.c a_d2i_fp.c a_digest.c \
30	a_dup.c a_enum.c a_gentm.c a_hdr.c a_i2d_fp.c a_int.c \
31	a_mbstr.c a_meth.c a_object.c a_octet.c a_print.c \
32	a_set.c a_sign.c a_strex.c a_strnid.c a_time.c a_type.c \
33	a_utctm.c a_utf8.c a_verify.c asn1_err.c asn1_lib.c \
34	asn1_par.c asn_moid.c asn_pack.c d2i_pr.c d2i_pu.c \
35	evp_asn1.c f_enum.c f_int.c f_string.c i2d_pr.c i2d_pu.c \
36	n_pkey.c nsseq.c p5_pbe.c p5_pbev2.c p8_pkey.c t_bitst.c \
37	t_crl.c t_pkey.c t_req.c t_spki.c t_x509.c t_x509a.c \
38	tasn_dec.c tasn_enc.c tasn_fre.c tasn_new.c tasn_typ.c \
39	tasn_utl.c x_algor.c x_attrib.c x_bignum.c x_crl.c \
40	x_exten.c x_info.c x_long.c x_name.c x_pkey.c x_pubkey.c \
41	x_req.c x_sig.c x_spki.c x_val.c x_x509.c x_x509a.c
42INCS+=	asn1.h asn1_mac.h asn1t.h
43
44# bf
45SRCS+=	bf_cfb64.c bf_ecb.c bf_ofb64.c bf_skey.c
46.if ${MACHINE_ARCH} == "i386"
47.if ${MACHINE_CPU:Mi686}
48SRCS+=	bf-686.s
49.else
50SRCS+=	bf-586.s
51.endif
52.else
53SRCS+=	bf_enc.c
54.endif
55INCS+=	blowfish.h
56
57# bio
58SRCS+=	b_dump.c b_print.c b_sock.c bf_buff.c bf_lbuf.c bf_nbio.c \
59	bf_null.c bio_cb.c bio_err.c bio_lib.c bss_acpt.c bss_bio.c \
60	bss_conn.c bss_fd.c bss_file.c bss_log.c bss_mem.c \
61	bss_null.c bss_sock.c
62INCS+=	bio.h
63
64# bn
65SRCS+=	bn_add.c bn_blind.c bn_ctx.c bn_div.c bn_err.c bn_exp.c \
66	bn_exp2.c bn_gcd.c bn_kron.c bn_lib.c bn_mod.c bn_mont.c \
67	bn_mpi.c bn_mul.c bn_prime.c bn_print.c bn_rand.c bn_recp.c \
68	bn_shift.c bn_sqr.c bn_sqrt.c bn_word.c
69.if ${MACHINE_ARCH} == "i386"
70SRCS+=	bn-586.s co-586.s
71.elif ${MACHINE_ARCH} == "amd64"
72SRCS+=	x86_64-gcc.c
73.else
74SRCS+=	bn_asm.c
75.endif
76
77INCS+=	bn.h
78
79# buffer
80SRCS+=	buf_err.c buffer.c
81INCS+=	buffer.h
82
83# cast
84SRCS+=	c_cfb64.c c_ecb.c c_ofb64.c c_skey.c
85.if ${MACHINE_ARCH} == "i386"
86SRCS+=	cast-586.s
87.else
88SRCS+=	c_enc.c
89.endif
90INCS+=	cast.h
91
92# comp
93SRCS+=	c_rle.c c_zlib.c comp_err.c comp_lib.c
94INCS+=	comp.h
95
96# conf
97SRCS+=	conf_api.c conf_def.c conf_err.c conf_lib.c conf_mall.c conf_mod.c conf_sap.c
98INCS+=	conf.h conf_api.h
99
100# des
101SRCS+=	cbc3_enc.c cbc_cksm.c cbc_enc.c cfb64ede.c cfb64enc.c cfb_enc.c \
102	des_old.c des_old2.c ecb3_enc.c ecb_enc.c ede_cbcm_enc.c \
103	enc_read.c enc_writ.c fcrypt.c ofb64ede.c ofb64enc.c \
104	ofb_enc.c pcbc_enc.c qud_cksm.c rand_key.c read2pwd.c \
105	rpc_enc.c set_key.c str2key.c xcbc_enc.c
106.if ${MACHINE_ARCH} == "i386"
107SRCS+=	des-586.s crypt586.s
108.else
109SRCS+=	des_enc.c fcrypt_b.c
110.endif
111INCS+=	des.h des_old.h
112
113# dh
114SRCS+=	dh_asn1.c dh_check.c dh_err.c dh_gen.c dh_key.c dh_lib.c
115INCS+=	dh.h
116
117# dsa
118SRCS+=	dsa_asn1.c dsa_err.c dsa_gen.c dsa_key.c dsa_lib.c dsa_ossl.c dsa_sign.c dsa_vrf.c
119INCS+=	dsa.h
120
121# dso
122SRCS+=	dso_dl.c dso_dlfcn.c dso_err.c dso_lib.c dso_null.c dso_openssl.c
123INCS+=	dso.h
124
125# ec
126SRCS+=	ec_cvt.c ec_err.c ec_lib.c ec_mult.c ecp_mont.c ecp_nist.c \
127	ecp_recp.c ecp_smpl.c
128INCS+=	ec.h
129
130# engine
131SRCS+=	eng_all.c eng_cnf.c eng_ctrl.c eng_dyn.c eng_err.c eng_fat.c \
132	eng_init.c eng_lib.c eng_list.c eng_openssl.c eng_padlock.c eng_pkey.c \
133	eng_table.c hw_4758_cca.c hw_4758_cca_err.c hw_aep.c hw_aep_err.c \
134	hw_atalla.c hw_atalla_err.c hw_cryptodev.c hw_cswift.c \
135	hw_cswift_err.c hw_ncipher.c hw_ncipher_err.c hw_nuron.c \
136	hw_nuron_err.c hw_sureware.c hw_sureware_err.c hw_ubsec.c \
137	hw_ubsec_err.c tb_cipher.c tb_dh.c tb_digest.c tb_dsa.c tb_rand.c \
138	tb_rsa.c
139INCS+=	eng_int.h engine.h hw_4758_cca_err.h hw_aep_err.h hw_atalla_err.h \
140	hw_cswift_err.h hw_ncipher_err.h hw_nuron_err.h hw_sureware_err.h \
141	hw_ubsec_err.h
142
143# err
144SRCS+=	err.c err_all.c err_prn.c
145INCS+=	err.h
146
147# evp
148SRCS+=	bio_b64.c bio_enc.c bio_md.c bio_ok.c c_all.c c_allc.c c_alld.c \
149	digest.c e_aes.c e_bf.c e_cast.c e_des.c e_des3.c e_idea.c \
150	e_null.c e_old.c e_rc2.c e_rc4.c e_rc5.c e_xcbc_d.c encode.c \
151	evp_acnf.c \
152	evp_enc.c evp_err.c evp_key.c evp_lib.c evp_pbe.c evp_pkey.c \
153	m_dss.c m_dss1.c m_md2.c m_md4.c m_md5.c m_mdc2.c m_null.c \
154	m_ripemd.c m_sha.c m_sha1.c names.c openbsd_hw.c p5_crpt.c \
155	p5_crpt2.c p_dec.c p_enc.c p_lib.c p_open.c p_seal.c p_sign.c \
156	p_verify.c
157INCS+=	evp.h
158
159# fips
160INCS+=	fips.h fips_rand.h
161
162# hmac
163SRCS+=	hmac.c
164INCS+=	hmac.h
165
166# idea
167.if defined(MAKE_IDEA)
168SRCS+=	i_cbc.c i_cfb64.c i_ecb.c i_ofb64.c i_skey.c
169INCS+=	idea.h
170.endif
171
172# krb5
173#SRCS+=	krb5_asn.c
174INCS+=	krb5_asn.h
175
176# lhash
177SRCS+=	lh_stats.c lhash.c
178INCS+=	lhash.h
179
180# md2
181SRCS+=	md2_dgst.c md2_one.c
182INCS+=	md2.h
183
184# md4
185SRCS+=	md4_dgst.c md4_one.c
186INCS+=	md4.h
187
188# md5
189SRCS+=	md5_dgst.c md5_one.c
190.if ${MACHINE_ARCH} == "i386"
191SRCS+=	md5-586.s
192.endif
193INCS+=	md5.h
194
195# mdc2
196SRCS+=	mdc2_one.c mdc2dgst.c
197INCS+=	mdc2.h
198
199# objects
200SRCS+=	o_names.c obj_dat.c obj_err.c obj_lib.c
201INCS+=	objects.h obj_mac.h
202
203# ocsp
204SRCS+=	ocsp_asn.c ocsp_cl.c ocsp_err.c ocsp_ext.c ocsp_ht.c \
205	ocsp_lib.c ocsp_prn.c ocsp_srv.c ocsp_vfy.c
206INCS+=	ocsp.h
207
208# pem
209SRCS+=	pem_all.c pem_err.c pem_info.c pem_lib.c pem_oth.c pem_pk8.c \
210	pem_pkey.c pem_seal.c pem_sign.c pem_x509.c pem_xaux.c
211INCS+=	pem.h pem2.h
212
213# pkcs12
214SRCS+=	p12_add.c p12_asn.c p12_attr.c p12_crpt.c p12_crt.c \
215	p12_decr.c p12_init.c p12_key.c p12_kiss.c p12_mutl.c \
216	p12_npas.c p12_p8d.c p12_p8e.c p12_utl.c pk12err.c
217INCS+=	pkcs12.h pkcs7.h
218
219# pkcs7
220SRCS+=	example.c pk7_asn1.c pk7_attr.c pk7_dgst.c pk7_doit.c \
221	pk7_lib.c pk7_mime.c pk7_smime.c pkcs7err.c
222
223# rand
224SRCS+=	md_rand.c rand_egd.c rand_err.c rand_lib.c rand_unix.c randfile.c
225INCS+=	rand.h
226
227# rc2
228SRCS+=	rc2_cbc.c rc2_ecb.c rc2_skey.c rc2cfb64.c rc2ofb64.c
229INCS+=	rc2.h
230
231# rc4
232SRCS+=	rc4_skey.c
233.if ${MACHINE_ARCH} == "i386"
234SRCS+=	rc4-586.s
235.else
236SRCS+=	rc4_enc.c
237.endif
238INCS+=	rc4.h
239
240# rc5
241SRCS+=	rc5_ecb.c rc5_skey.c rc5cfb64.c rc5ofb64.c
242.if ${MACHINE_ARCH} == "i386"
243SRCS+=	rc5-586.s
244.else
245SRCS+=	rc5_enc.c
246.endif
247INCS+=	rc5.h
248
249# ripemd
250SRCS+=	rmd_dgst.c rmd_one.c
251INCS+=	ripemd.h
252
253# rsa
254SRCS+=	rsa_asn1.c rsa_chk.c rsa_eay.c rsa_err.c rsa_gen.c rsa_lib.c \
255	rsa_none.c rsa_null.c rsa_oaep.c rsa_pk1.c rsa_saos.c \
256	rsa_sign.c rsa_ssl.c
257INCS+=	rsa.h
258
259# sha
260SRCS+=	sha1_one.c sha1dgst.c sha_dgst.c sha_one.c
261.if ${MACHINE_ARCH} == "i386"
262SRCS+=	sha1-586.s
263.endif
264INCS+=	sha.h
265
266# stack
267SRCS+=	stack.c
268INCS+=	stack.h safestack.h
269
270# threads
271SRCS+=	th-lock.c
272
273# txt_db
274SRCS+=	txt_db.c
275INCS+=	txt_db.h
276
277# ui
278SRCS+=	ui_compat.c ui_err.c ui_lib.c ui_openssl.c ui_util.c
279INCS+=	ui.h ui_compat.h ui_locl.h
280
281# x509
282SRCS+=	by_dir.c by_file.c x509_att.c x509_cmp.c x509_d2.c \
283	x509_def.c x509_err.c x509_ext.c x509_lu.c x509_obj.c \
284	x509_r2x.c x509_req.c x509_set.c x509_trs.c x509_txt.c \
285	x509_v3.c x509_vfy.c x509cset.c x509name.c x509rset.c \
286	x509spki.c x509type.c x_all.c
287INCS+=	x509.h x509_vfy.h
288
289# x509v3
290SRCS+=	v3_akey.c v3_akeya.c v3_alt.c v3_bcons.c v3_bitst.c \
291	v3_conf.c v3_cpols.c v3_crld.c v3_enum.c v3_extku.c \
292	v3_genn.c v3_ia5.c v3_info.c v3_int.c v3_lib.c v3_ocsp.c \
293	v3_pku.c v3_prn.c v3_purp.c v3_skey.c v3_sxnet.c v3_utl.c v3err.c
294INCS+=	x509v3.h
295
296SRCS+=	buildinf.h
297INCS+=	opensslconf.h evp.h
298INCSDIR=	${INCLUDEDIR}/openssl
299
300CSTD=	gnu89
301
302CLEANFILES=	buildinf.h opensslconf.h evp.h
303
304buildinf.h: ${.CURDIR}/Makefile
305	( echo "#ifndef MK1MF_BUILD"; \
306	echo "  /* auto-generated by crypto/Makefile.ssl for crypto/cversion.c */"; \
307	echo "  #define CFLAGS \"$(CC)\""; \
308	echo "  #define PLATFORM \"FreeBSD-${MACHINE_ARCH}\""; \
309	echo "  #define DATE \"`LC_ALL=C date`\""; \
310	echo "#endif" ) > ${.TARGET}
311
312opensslconf.h: opensslconf-${MACHINE_ARCH}.h
313	cp ${.ALLSRC} ${.TARGET}
314
315evp.h: ${LCRYPTO_SRC}/crypto/evp/evp.h
316.if !defined(MAKE_IDEA)
317	sed '/^#ifndef OPENSSL_NO_IDEA$$/,/^#endif$$/d' ${.ALLSRC} > ${.TARGET}
318.else
319	cp ${.ALLSRC} ${.TARGET}
320.endif
321
322# No FIPS support for now
323fips.h:
324	echo '/* dummy fips.h */' > ${.TARGET}
325
326fips_rand.h:
327	echo '/* dummy fips_rand.h */' > ${.TARGET}
328
329OLDSYMLINKS+=	libdes.a libdes.so libdes.so.3 libdes_p.a
330afterinstall:
331	@${ECHO} "Removing stale symlinks."
332	rm -f ${DESTDIR}${INCLUDEDIR}/des.h
333.for symlink in ${OLDSYMLINKS}
334	rm -f ${DESTDIR}${LIBDIR}/${symlink}
335.endfor
336
337.include <bsd.lib.mk>
338
339.if ${MACHINE_ARCH} == "i386"
340.PATH: ${.CURDIR}/i386
341.endif
342
343.if ${MACHINE_ARCH} == "amd64"
344_bn_asmpath=	${LCRYPTO_SRC}/crypto/bn/asm
345.endif
346
347.if defined(MAKE_IDEA)
348_ideapath=	${LCRYPTO_SRC}/crypto/idea
349.endif
350
351.PATH: \
352	${LCRYPTO_SRC}/crypto \
353	${LCRYPTO_SRC}/crypto/aes \
354	${LCRYPTO_SRC}/crypto/asn1 \
355	${LCRYPTO_SRC}/crypto/bf \
356	${LCRYPTO_SRC}/crypto/bio \
357	${_bn_asmpath} \
358	${LCRYPTO_SRC}/crypto/bn \
359	${LCRYPTO_SRC}/crypto/buffer \
360	${LCRYPTO_SRC}/crypto/cast \
361	${LCRYPTO_SRC}/crypto/comp \
362	${LCRYPTO_SRC}/crypto/conf \
363	${LCRYPTO_SRC}/crypto/des \
364	${LCRYPTO_SRC}/crypto/dh \
365	${LCRYPTO_SRC}/crypto/dsa \
366	${LCRYPTO_SRC}/crypto/dso \
367	${LCRYPTO_SRC}/crypto/ec \
368	${LCRYPTO_SRC}/crypto/engine \
369	${LCRYPTO_SRC}/crypto/err \
370	${LCRYPTO_SRC}/crypto/evp \
371	${LCRYPTO_SRC}/crypto/hmac \
372	${_ideapath} \
373	${LCRYPTO_SRC}/crypto/krb5 \
374	${LCRYPTO_SRC}/crypto/lhash \
375	${LCRYPTO_SRC}/crypto/md2 \
376	${LCRYPTO_SRC}/crypto/md4 \
377	${LCRYPTO_SRC}/crypto/md5 \
378	${LCRYPTO_SRC}/crypto/mdc2 \
379	${LCRYPTO_SRC}/crypto/objects \
380	${LCRYPTO_SRC}/crypto/ocsp \
381	${LCRYPTO_SRC}/crypto/pem \
382	${LCRYPTO_SRC}/crypto/pkcs12 \
383	${LCRYPTO_SRC}/crypto/pkcs7 \
384	${LCRYPTO_SRC}/crypto/rand \
385	${LCRYPTO_SRC}/crypto/rc2 \
386	${LCRYPTO_SRC}/crypto/rc4 \
387	${LCRYPTO_SRC}/crypto/rc5 \
388	${LCRYPTO_SRC}/crypto/ripemd \
389	${LCRYPTO_SRC}/crypto/rsa \
390	${LCRYPTO_SRC}/crypto/sha \
391	${LCRYPTO_SRC}/crypto/stack \
392	${LCRYPTO_SRC}/crypto/threads \
393	${LCRYPTO_SRC}/crypto/txt_db \
394	${LCRYPTO_SRC}/crypto/ui \
395	${LCRYPTO_SRC}/crypto/x509 \
396	${LCRYPTO_SRC}/crypto/x509v3 \
397	${LCRYPTO_SRC} \
398	${.CURDIR}/man
399