xref: /freebsd/secure/lib/libcrypto/Makefile (revision 41d8423f714369ea23708399e02792045f9c3f56)
1# $FreeBSD$
2
3LIB=		crypto
4SHLIBDIR?=	/lib
5SHLIB_MAJOR=	3
6
7NOLINT=		true
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 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_enc.c bf_ofb64.c bf_skey.c
46INCS+=	blowfish.h
47
48# bio
49SRCS+=	b_dump.c b_print.c b_sock.c bf_buff.c bf_lbuf.c bf_nbio.c \
50	bf_null.c bio_cb.c bio_err.c bio_lib.c bss_acpt.c bss_bio.c \
51	bss_conn.c bss_fd.c bss_file.c bss_log.c bss_mem.c \
52	bss_null.c bss_sock.c
53INCS+=	bio.h
54
55# bn
56SRCS+=	bn_add.c bn_asm.c bn_blind.c bn_ctx.c bn_div.c bn_err.c bn_exp.c \
57	bn_exp2.c bn_gcd.c bn_kron.c bn_lib.c bn_mod.c bn_mont.c \
58	bn_mpi.c bn_mul.c bn_prime.c bn_print.c bn_rand.c bn_recp.c \
59	bn_shift.c bn_sqr.c bn_sqrt.c bn_word.c
60INCS+=	bn.h
61
62# buffer
63SRCS+=	buf_err.c buffer.c
64INCS+=	buffer.h
65
66# cast
67SRCS+=	c_cfb64.c c_ecb.c c_enc.c c_ofb64.c c_skey.c
68INCS+=	cast.h
69
70# comp
71SRCS+=	c_rle.c c_zlib.c comp_err.c comp_lib.c
72INCS+=	comp.h
73
74# conf
75SRCS+=	conf_api.c conf_def.c conf_err.c conf_lib.c conf_mall.c conf_mod.c conf_sap.c
76INCS+=	conf.h conf_api.h
77
78# des
79SRCS+=	cbc3_enc.c cbc_cksm.c cbc_enc.c cfb64ede.c cfb64enc.c cfb_enc.c \
80	des_enc.c des_old.c des_old2.c ecb3_enc.c ecb_enc.c ede_cbcm_enc.c \
81	enc_read.c enc_writ.c fcrypt.c fcrypt_b.c ofb64ede.c ofb64enc.c \
82	ofb_enc.c pcbc_enc.c qud_cksm.c rand_key.c read2pwd.c \
83	rpc_enc.c set_key.c str2key.c xcbc_enc.c
84INCS+=	des.h des_old.h
85
86# dh
87SRCS+=	dh_asn1.c dh_check.c dh_err.c dh_gen.c dh_key.c dh_lib.c
88INCS+=	dh.h
89
90# dsa
91SRCS+=	dsa_asn1.c dsa_err.c dsa_gen.c dsa_key.c dsa_lib.c dsa_ossl.c dsa_sign.c dsa_vrf.c
92INCS+=	dsa.h
93
94# dso
95SRCS+=	dso_dl.c dso_dlfcn.c dso_err.c dso_lib.c dso_null.c dso_openssl.c
96INCS+=	dso.h
97
98# ec
99SRCS+=	ec_cvt.c ec_err.c ec_lib.c ec_mult.c ecp_mont.c ecp_nist.c \
100	ecp_recp.c ecp_smpl.c
101INCS+=	ec.h
102
103# engine
104SRCS+=	eng_all.c eng_cnf.c eng_ctrl.c eng_dyn.c eng_err.c eng_fat.c \
105	eng_init.c eng_lib.c eng_list.c eng_openssl.c eng_pkey.c \
106	eng_table.c hw_4758_cca.c hw_4758_cca_err.c hw_aep.c hw_aep_err.c \
107	hw_atalla.c hw_atalla_err.c hw_cryptodev.c hw_cswift.c \
108	hw_cswift_err.c hw_ncipher.c hw_ncipher_err.c hw_nuron.c \
109	hw_nuron_err.c hw_sureware.c hw_sureware_err.c hw_ubsec.c \
110	hw_ubsec_err.c tb_cipher.c tb_dh.c tb_digest.c tb_dsa.c tb_rand.c \
111	tb_rsa.c
112INCS+=	eng_int.h engine.h hw_4758_cca_err.h hw_aep_err.h hw_atalla_err.h \
113	hw_cswift_err.h hw_ncipher_err.h hw_nuron_err.h hw_sureware_err.h \
114	hw_ubsec_err.h
115
116# err
117SRCS+=	err.c err_all.c err_prn.c
118INCS+=	err.h
119
120# evp
121SRCS+=	bio_b64.c bio_enc.c bio_md.c bio_ok.c c_all.c c_allc.c c_alld.c \
122	digest.c e_aes.c e_bf.c e_cast.c e_des.c e_des3.c e_idea.c \
123	e_null.c e_rc2.c e_rc4.c e_rc5.c e_xcbc_d.c encode.c evp_acnf.c \
124	evp_enc.c evp_err.c evp_key.c evp_lib.c evp_pbe.c evp_pkey.c \
125	m_dss.c m_dss1.c m_md2.c m_md4.c m_md5.c m_mdc2.c m_null.c \
126	m_ripemd.c m_sha.c m_sha1.c names.c openbsd_hw.c p5_crpt.c \
127	p5_crpt2.c p_dec.c p_enc.c p_lib.c p_open.c p_seal.c p_sign.c \
128	p_verify.c
129
130# hmac
131SRCS+=	hmac.c
132INCS+=	hmac.h
133
134# idea
135.if defined(MAKE_IDEA) && ${MAKE_IDEA} == YES
136SRCS+=	i_cbc.c i_cfb64.c i_ecb.c i_ofb64.c i_skey.c
137INCS+=	idea.h
138.endif
139
140# krb5
141#SRCS+=	krb5_asn.c
142INCS+=	krb5_asn.h
143
144# lhash
145SRCS+=	lh_stats.c lhash.c
146INCS+=	lhash.h
147
148# md2
149SRCS+=	md2_dgst.c md2_one.c
150INCS+=	md2.h
151
152# md4
153SRCS+=	md4_dgst.c md4_one.c
154INCS+=	md4.h
155
156# md5
157SRCS+=	md5_dgst.c md5_one.c
158INCS+=	md5.h
159
160# mdc2
161SRCS+=	mdc2_one.c mdc2dgst.c
162INCS+=	mdc2.h
163
164# objects
165SRCS+=	o_names.c obj_dat.c obj_err.c obj_lib.c
166INCS+=	objects.h obj_mac.h
167
168# ocsp
169SRCS+=	ocsp_asn.c ocsp_cl.c ocsp_err.c ocsp_ext.c ocsp_ht.c \
170	ocsp_lib.c ocsp_prn.c ocsp_srv.c ocsp_vfy.c
171INCS+=	ocsp.h
172
173# pem
174SRCS+=	pem_all.c pem_err.c pem_info.c pem_lib.c pem_oth.c pem_pk8.c \
175	pem_pkey.c pem_seal.c pem_sign.c pem_x509.c pem_xaux.c
176INCS+=	pem.h pem2.h
177
178# pkcs12
179SRCS+=	p12_add.c p12_asn.c p12_attr.c p12_crpt.c p12_crt.c \
180	p12_decr.c p12_init.c p12_key.c p12_kiss.c p12_mutl.c \
181	p12_npas.c p12_p8d.c p12_p8e.c p12_utl.c pk12err.c
182INCS+=	pkcs12.h pkcs7.h
183
184# pkcs7
185SRCS+=	example.c pk7_asn1.c pk7_attr.c pk7_dgst.c pk7_doit.c \
186	pk7_lib.c pk7_mime.c pk7_smime.c pkcs7err.c
187
188# rand
189SRCS+=	md_rand.c rand_egd.c rand_err.c rand_lib.c rand_unix.c randfile.c
190INCS+=	rand.h
191
192# rc2
193SRCS+=	rc2_cbc.c rc2_ecb.c rc2_skey.c rc2cfb64.c rc2ofb64.c
194INCS+=	rc2.h
195
196# rc4
197SRCS+=	rc4_enc.c rc4_skey.c
198INCS+=	rc4.h
199
200# rc5
201SRCS+=	rc5_ecb.c rc5_enc.c rc5_skey.c rc5cfb64.c rc5ofb64.c
202INCS+=	rc5.h
203
204# ripemd
205SRCS+=	rmd_dgst.c rmd_one.c
206INCS+=	ripemd.h
207
208# rsa
209SRCS+=	rsa_asn1.c rsa_chk.c rsa_eay.c rsa_err.c rsa_gen.c rsa_lib.c \
210	rsa_none.c rsa_null.c rsa_oaep.c rsa_pk1.c rsa_saos.c \
211	rsa_sign.c rsa_ssl.c
212INCS+=	rsa.h
213
214# sha
215SRCS+=	sha1_one.c sha1dgst.c sha_dgst.c sha_one.c
216INCS+=	sha.h
217
218# stack
219SRCS+=	stack.c
220INCS+=	stack.h safestack.h
221
222# threads
223SRCS+=	th-lock.c
224
225# txt_db
226SRCS+=	txt_db.c
227INCS+=	txt_db.h
228
229# ui
230SRCS+=	ui_compat.c ui_err.c ui_lib.c ui_openssl.c ui_util.c
231INCS+=	ui.h ui_compat.h ui_locl.h
232
233# x509
234SRCS+=	by_dir.c by_file.c x509_att.c x509_cmp.c x509_d2.c \
235	x509_def.c x509_err.c x509_ext.c x509_lu.c x509_obj.c \
236	x509_r2x.c x509_req.c x509_set.c x509_trs.c x509_txt.c \
237	x509_v3.c x509_vfy.c x509cset.c x509name.c x509rset.c \
238	x509spki.c x509type.c x_all.c
239INCS+=	x509.h x509_vfy.h
240
241# x509v3
242SRCS+=	v3_akey.c v3_akeya.c v3_alt.c v3_bcons.c v3_bitst.c \
243	v3_conf.c v3_cpols.c v3_crld.c v3_enum.c v3_extku.c \
244	v3_genn.c v3_ia5.c v3_info.c v3_int.c v3_lib.c v3_ocsp.c \
245	v3_pku.c v3_prn.c v3_purp.c v3_skey.c v3_sxnet.c v3_utl.c v3err.c
246INCS+=	x509v3.h
247
248SRCS+=	buildinf.h
249INCS+=	opensslconf.h evp.h
250INCSDIR=	${INCLUDEDIR}/openssl
251
252CSTD=	gnu89
253
254CLEANFILES=	buildinf.h opensslconf.h evp.h
255
256buildinf.h:
257	( echo "#ifndef MK1MF_BUILD"; \
258	echo "  /* auto-generated by crypto/Makefile.ssl for crypto/cversion.c */"; \
259	echo "  #define CFLAGS \"$(CC)\""; \
260	echo "  #define PLATFORM \"`uname -s`-`uname -m`\""; \
261	echo "  #define DATE \"`LC_ALL=C date`\""; \
262	echo "#endif" ) > ${.TARGET}
263
264opensslconf.h: opensslconf-${MACHINE_ARCH}.h
265	cp ${.ALLSRC} ${.TARGET}
266
267evp.h: ${LCRYPTO_SRC}/crypto/evp/evp.h
268.if !defined(MAKE_IDEA) || ${MAKE_IDEA} != YES
269	sed '/^#ifndef OPENSSL_NO_IDEA$$/,/^#endif$$/d' ${.ALLSRC} > ${.TARGET}
270.else
271	cp ${.ALLSRC} ${.TARGET}
272.endif
273
274OLDSYMLINKS+=	libdes.a libdes.so libdes.so.3 libdes_p.a
275afterinstall:
276	@${ECHO} "Removing stale symlinks."
277	rm -f ${DESTDIR}${INCLUDEDIR}/des.h
278.for symlink in ${OLDSYMLINKS}
279	rm -f ${DESTDIR}${LIBDIR}/${symlink}
280.endfor
281
282.include <bsd.lib.mk>
283
284.if defined(MAKE_IDEA) && ${MAKE_IDEA} == YES
285_ideapath=	${LCRYPTO_SRC}/crypto/idea
286.endif
287
288.PATH: \
289	${LCRYPTO_SRC}/crypto \
290	${LCRYPTO_SRC}/crypto/aes \
291	${LCRYPTO_SRC}/crypto/asn1 \
292	${LCRYPTO_SRC}/crypto/bf \
293	${LCRYPTO_SRC}/crypto/bio \
294	${LCRYPTO_SRC}/crypto/bn \
295	${LCRYPTO_SRC}/crypto/buffer \
296	${LCRYPTO_SRC}/crypto/cast \
297	${LCRYPTO_SRC}/crypto/comp \
298	${LCRYPTO_SRC}/crypto/conf \
299	${LCRYPTO_SRC}/crypto/des \
300	${LCRYPTO_SRC}/crypto/dh \
301	${LCRYPTO_SRC}/crypto/dsa \
302	${LCRYPTO_SRC}/crypto/dso \
303	${LCRYPTO_SRC}/crypto/ec \
304	${LCRYPTO_SRC}/crypto/engine \
305	${LCRYPTO_SRC}/crypto/err \
306	${LCRYPTO_SRC}/crypto/evp \
307	${LCRYPTO_SRC}/crypto/hmac \
308	${_ideapath} \
309	${LCRYPTO_SRC}/crypto/krb5 \
310	${LCRYPTO_SRC}/crypto/lhash \
311	${LCRYPTO_SRC}/crypto/md2 \
312	${LCRYPTO_SRC}/crypto/md4 \
313	${LCRYPTO_SRC}/crypto/md5 \
314	${LCRYPTO_SRC}/crypto/mdc2 \
315	${LCRYPTO_SRC}/crypto/objects \
316	${LCRYPTO_SRC}/crypto/ocsp \
317	${LCRYPTO_SRC}/crypto/pem \
318	${LCRYPTO_SRC}/crypto/pkcs12 \
319	${LCRYPTO_SRC}/crypto/pkcs7 \
320	${LCRYPTO_SRC}/crypto/rand \
321	${LCRYPTO_SRC}/crypto/rc2 \
322	${LCRYPTO_SRC}/crypto/rc4 \
323	${LCRYPTO_SRC}/crypto/rc5 \
324	${LCRYPTO_SRC}/crypto/ripemd \
325	${LCRYPTO_SRC}/crypto/rsa \
326	${LCRYPTO_SRC}/crypto/sha \
327	${LCRYPTO_SRC}/crypto/stack \
328	${LCRYPTO_SRC}/crypto/threads \
329	${LCRYPTO_SRC}/crypto/txt_db \
330	${LCRYPTO_SRC}/crypto/ui \
331	${LCRYPTO_SRC}/crypto/x509 \
332	${LCRYPTO_SRC}/crypto/x509v3 \
333	${LCRYPTO_SRC} \
334	${.CURDIR}/man
335