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