1# $FreeBSD$ 2 3LIB= crypto 4SHLIBDIR?= /lib 5SHLIB_MAJOR= 3 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 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_rc2.c e_rc4.c e_rc5.c e_xcbc_d.c encode.c evp_acnf.c \ 151 evp_enc.c evp_err.c evp_key.c evp_lib.c evp_pbe.c evp_pkey.c \ 152 m_dss.c m_dss1.c m_md2.c m_md4.c m_md5.c m_mdc2.c m_null.c \ 153 m_ripemd.c m_sha.c m_sha1.c names.c openbsd_hw.c p5_crpt.c \ 154 p5_crpt2.c p_dec.c p_enc.c p_lib.c p_open.c p_seal.c p_sign.c \ 155 p_verify.c 156INCS+= evp.h 157 158# hmac 159SRCS+= hmac.c 160INCS+= hmac.h 161 162# idea 163.if defined(MAKE_IDEA) 164SRCS+= i_cbc.c i_cfb64.c i_ecb.c i_ofb64.c i_skey.c 165INCS+= idea.h 166.endif 167 168# krb5 169#SRCS+= krb5_asn.c 170INCS+= krb5_asn.h 171 172# lhash 173SRCS+= lh_stats.c lhash.c 174INCS+= lhash.h 175 176# md2 177SRCS+= md2_dgst.c md2_one.c 178INCS+= md2.h 179 180# md4 181SRCS+= md4_dgst.c md4_one.c 182INCS+= md4.h 183 184# md5 185SRCS+= md5_dgst.c md5_one.c 186.if ${MACHINE_ARCH} == "i386" 187SRCS+= md5-586.s 188.endif 189INCS+= md5.h 190 191# mdc2 192SRCS+= mdc2_one.c mdc2dgst.c 193INCS+= mdc2.h 194 195# objects 196SRCS+= o_names.c obj_dat.c obj_err.c obj_lib.c 197INCS+= objects.h obj_mac.h 198 199# ocsp 200SRCS+= ocsp_asn.c ocsp_cl.c ocsp_err.c ocsp_ext.c ocsp_ht.c \ 201 ocsp_lib.c ocsp_prn.c ocsp_srv.c ocsp_vfy.c 202INCS+= ocsp.h 203 204# pem 205SRCS+= pem_all.c pem_err.c pem_info.c pem_lib.c pem_oth.c pem_pk8.c \ 206 pem_pkey.c pem_seal.c pem_sign.c pem_x509.c pem_xaux.c 207INCS+= pem.h pem2.h 208 209# pkcs12 210SRCS+= p12_add.c p12_asn.c p12_attr.c p12_crpt.c p12_crt.c \ 211 p12_decr.c p12_init.c p12_key.c p12_kiss.c p12_mutl.c \ 212 p12_npas.c p12_p8d.c p12_p8e.c p12_utl.c pk12err.c 213INCS+= pkcs12.h pkcs7.h 214 215# pkcs7 216SRCS+= example.c pk7_asn1.c pk7_attr.c pk7_dgst.c pk7_doit.c \ 217 pk7_lib.c pk7_mime.c pk7_smime.c pkcs7err.c 218 219# rand 220SRCS+= md_rand.c rand_egd.c rand_err.c rand_lib.c rand_unix.c randfile.c 221INCS+= rand.h 222 223# rc2 224SRCS+= rc2_cbc.c rc2_ecb.c rc2_skey.c rc2cfb64.c rc2ofb64.c 225INCS+= rc2.h 226 227# rc4 228SRCS+= rc4_skey.c 229.if ${MACHINE_ARCH} == "i386" 230SRCS+= rc4-586.s 231.else 232SRCS+= rc4_enc.c 233.endif 234INCS+= rc4.h 235 236# rc5 237SRCS+= rc5_ecb.c rc5_skey.c rc5cfb64.c rc5ofb64.c 238.if ${MACHINE_ARCH} == "i386" 239SRCS+= rc5-586.s 240.else 241SRCS+= rc5_enc.c 242.endif 243INCS+= rc5.h 244 245# ripemd 246SRCS+= rmd_dgst.c rmd_one.c 247INCS+= ripemd.h 248 249# rsa 250SRCS+= rsa_asn1.c rsa_chk.c rsa_eay.c rsa_err.c rsa_gen.c rsa_lib.c \ 251 rsa_none.c rsa_null.c rsa_oaep.c rsa_pk1.c rsa_saos.c \ 252 rsa_sign.c rsa_ssl.c 253INCS+= rsa.h 254 255# sha 256SRCS+= sha1_one.c sha1dgst.c sha_dgst.c sha_one.c 257.if ${MACHINE_ARCH} == "i386" 258SRCS+= sha1-586.s 259.endif 260INCS+= sha.h 261 262# stack 263SRCS+= stack.c 264INCS+= stack.h safestack.h 265 266# threads 267SRCS+= th-lock.c 268 269# txt_db 270SRCS+= txt_db.c 271INCS+= txt_db.h 272 273# ui 274SRCS+= ui_compat.c ui_err.c ui_lib.c ui_openssl.c ui_util.c 275INCS+= ui.h ui_compat.h ui_locl.h 276 277# x509 278SRCS+= by_dir.c by_file.c x509_att.c x509_cmp.c x509_d2.c \ 279 x509_def.c x509_err.c x509_ext.c x509_lu.c x509_obj.c \ 280 x509_r2x.c x509_req.c x509_set.c x509_trs.c x509_txt.c \ 281 x509_v3.c x509_vfy.c x509cset.c x509name.c x509rset.c \ 282 x509spki.c x509type.c x_all.c 283INCS+= x509.h x509_vfy.h 284 285# x509v3 286SRCS+= v3_akey.c v3_akeya.c v3_alt.c v3_bcons.c v3_bitst.c \ 287 v3_conf.c v3_cpols.c v3_crld.c v3_enum.c v3_extku.c \ 288 v3_genn.c v3_ia5.c v3_info.c v3_int.c v3_lib.c v3_ocsp.c \ 289 v3_pku.c v3_prn.c v3_purp.c v3_skey.c v3_sxnet.c v3_utl.c v3err.c 290INCS+= x509v3.h 291 292SRCS+= buildinf.h 293INCS+= opensslconf.h evp.h 294INCSDIR= ${INCLUDEDIR}/openssl 295 296CSTD= gnu89 297 298CLEANFILES= buildinf.h opensslconf.h evp.h 299 300buildinf.h: 301 ( echo "#ifndef MK1MF_BUILD"; \ 302 echo " /* auto-generated by crypto/Makefile.ssl for crypto/cversion.c */"; \ 303 echo " #define CFLAGS \"$(CC)\""; \ 304 echo " #define PLATFORM \"`uname -s`-`uname -m`\""; \ 305 echo " #define DATE \"`LC_ALL=C date`\""; \ 306 echo "#endif" ) > ${.TARGET} 307 308opensslconf.h: opensslconf-${MACHINE_ARCH}.h 309 cp ${.ALLSRC} ${.TARGET} 310 311evp.h: ${LCRYPTO_SRC}/crypto/evp/evp.h 312.if !defined(MAKE_IDEA) 313 sed '/^#ifndef OPENSSL_NO_IDEA$$/,/^#endif$$/d' ${.ALLSRC} > ${.TARGET} 314.else 315 cp ${.ALLSRC} ${.TARGET} 316.endif 317 318OLDSYMLINKS+= libdes.a libdes.so libdes.so.3 libdes_p.a 319afterinstall: 320 @${ECHO} "Removing stale symlinks." 321 rm -f ${DESTDIR}${INCLUDEDIR}/des.h 322.for symlink in ${OLDSYMLINKS} 323 rm -f ${DESTDIR}${LIBDIR}/${symlink} 324.endfor 325 326.include <bsd.lib.mk> 327 328.if ${MACHINE_ARCH} == "i386" 329.PATH: ${.CURDIR}/i386 330.endif 331 332.if ${MACHINE_ARCH} == "amd64" 333_bn_asmpath= ${LCRYPTO_SRC}/crypto/bn/asm 334.endif 335 336.if defined(MAKE_IDEA) 337_ideapath= ${LCRYPTO_SRC}/crypto/idea 338.endif 339 340.PATH: \ 341 ${LCRYPTO_SRC}/crypto \ 342 ${LCRYPTO_SRC}/crypto/aes \ 343 ${LCRYPTO_SRC}/crypto/asn1 \ 344 ${LCRYPTO_SRC}/crypto/bf \ 345 ${LCRYPTO_SRC}/crypto/bio \ 346 ${_bn_asmpath} \ 347 ${LCRYPTO_SRC}/crypto/bn \ 348 ${LCRYPTO_SRC}/crypto/buffer \ 349 ${LCRYPTO_SRC}/crypto/cast \ 350 ${LCRYPTO_SRC}/crypto/comp \ 351 ${LCRYPTO_SRC}/crypto/conf \ 352 ${LCRYPTO_SRC}/crypto/des \ 353 ${LCRYPTO_SRC}/crypto/dh \ 354 ${LCRYPTO_SRC}/crypto/dsa \ 355 ${LCRYPTO_SRC}/crypto/dso \ 356 ${LCRYPTO_SRC}/crypto/ec \ 357 ${LCRYPTO_SRC}/crypto/engine \ 358 ${LCRYPTO_SRC}/crypto/err \ 359 ${LCRYPTO_SRC}/crypto/evp \ 360 ${LCRYPTO_SRC}/crypto/hmac \ 361 ${_ideapath} \ 362 ${LCRYPTO_SRC}/crypto/krb5 \ 363 ${LCRYPTO_SRC}/crypto/lhash \ 364 ${LCRYPTO_SRC}/crypto/md2 \ 365 ${LCRYPTO_SRC}/crypto/md4 \ 366 ${LCRYPTO_SRC}/crypto/md5 \ 367 ${LCRYPTO_SRC}/crypto/mdc2 \ 368 ${LCRYPTO_SRC}/crypto/objects \ 369 ${LCRYPTO_SRC}/crypto/ocsp \ 370 ${LCRYPTO_SRC}/crypto/pem \ 371 ${LCRYPTO_SRC}/crypto/pkcs12 \ 372 ${LCRYPTO_SRC}/crypto/pkcs7 \ 373 ${LCRYPTO_SRC}/crypto/rand \ 374 ${LCRYPTO_SRC}/crypto/rc2 \ 375 ${LCRYPTO_SRC}/crypto/rc4 \ 376 ${LCRYPTO_SRC}/crypto/rc5 \ 377 ${LCRYPTO_SRC}/crypto/ripemd \ 378 ${LCRYPTO_SRC}/crypto/rsa \ 379 ${LCRYPTO_SRC}/crypto/sha \ 380 ${LCRYPTO_SRC}/crypto/stack \ 381 ${LCRYPTO_SRC}/crypto/threads \ 382 ${LCRYPTO_SRC}/crypto/txt_db \ 383 ${LCRYPTO_SRC}/crypto/ui \ 384 ${LCRYPTO_SRC}/crypto/x509 \ 385 ${LCRYPTO_SRC}/crypto/x509v3 \ 386 ${LCRYPTO_SRC} \ 387 ${.CURDIR}/man 388