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