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