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