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