Merge from vendor branch OPENSSL:
[dragonfly.git] / secure / lib / libcrypto / Makefile.inc
CommitLineData
984263bc 1# $FreeBSD: src/secure/lib/libcrypto/Makefile.inc,v 1.7.2.11 2003/02/20 15:07:32 nectar Exp $
48720e0e 2# $DragonFly: src/secure/lib/libcrypto/Makefile.inc,v 1.7 2004/12/18 20:53:19 asmodai Exp $
984263bc 3
48720e0e 4OSSLVERSION= 0.9.7e
65b98162
JR
5LCRYPTO_SRC= ${.CURDIR}/../../../crypto/openssl-${OSSLVERSION}
6LCRYPTO_DOC= ${.CURDIR}/../../../crypto/openssl-${OSSLVERSION}/doc
984263bc
MD
7
8CFLAGS+= -DTERMIOS -DANSI_SOURCE
9CFLAGS+= -I${LCRYPTO_SRC} -I${LCRYPTO_SRC}/crypto \
10 -I${LCRYPTO_SRC}/crypto/engine -I${.OBJDIR}
11
12.if !defined(MAKE_IDEA) || ${MAKE_IDEA} != YES
13CFLAGS+= -DOPENSSL_NO_IDEA
14.else
15_idea_h= idea/idea.h
16.endif
17
18.if ${MACHINE_ARCH} == "i386"
19CFLAGS+= -DL_ENDIAN
20.elif ${MACHINE_ARCH} == "alpha"
21# no ENDIAN stuff defined for alpha (64-bit)
22.endif
23
24HDRS+= \
25 ../e_os.h ../e_os2.h \
26 crypto.h \
27 ebcdic.h \
28 opensslv.h \
29 ossl_typ.h \
30 symhacks.h \
31 tmdiff.h \
32 aes/aes.h aes/aes_locl.h \
33 asn1/asn1.h asn1/asn1_mac.h asn1/asn1t.h \
34 bio/bio.h \
35 bf/blowfish.h \
36 bn/bn.h \
37 buffer/buffer.h \
38 cast/cast.h \
39 comp/comp.h \
40 conf/conf.h conf/conf_api.h \
41 des/des.h des/des_old.h \
42 dh/dh.h \
43 dsa/dsa.h \
44 dso/dso.h \
45 ec/ec.h \
46 engine/eng_int.h engine/engine.h engine/hw_4758_cca_err.h \
47 engine/hw_aep_err.h engine/hw_atalla_err.h engine/hw_cswift_err.h \
48 engine/hw_ncipher_err.h engine/hw_nuron_err.h engine/hw_sureware_err.h \
49 engine/hw_ubsec_err.h \
50 err/err.h \
48720e0e 51 ../fips/fips.h ../fips/rand/fips_rand.h \
984263bc
MD
52 hmac/hmac.h \
53 ${_idea_h} \
54 krb5/krb5_asn.h \
55 lhash/lhash.h \
56 md2/md2.h \
57 md4/md4.h \
58 md5/md5.h \
59 mdc2/mdc2.h \
60 ocsp/ocsp.h \
61 objects/objects.h objects/obj_mac.h \
62 pem/pem.h pem/pem2.h \
63 pkcs12/pkcs12.h pkcs7/pkcs7.h \
64 rand/rand.h \
65 rc2/rc2.h rc4/rc4.h rc5/rc5.h \
66 ripemd/ripemd.h \
67 rsa/rsa.h \
68 stack/stack.h stack/safestack.h \
69 sha/sha.h \
70 txt_db/txt_db.h \
71 ui/ui.h ui/ui_compat.h ui/ui_locl.h \
72 x509/x509.h x509/x509_vfy.h x509v3/x509v3.h
73
74SRCS+= buildinf.h openssl/opensslconf.h openssl/evp.h
75CLEANFILES+= buildinf.h openssl/opensslconf.h openssl/evp.h
76CLEANDIRS+= openssl
77
78buildinf.h:
79 ( echo "#ifndef MK1MF_BUILD"; \
80 echo " /* auto-generated by crypto/Makefile.ssl for crypto/cversion.c */"; \
81 echo " #define CFLAGS \"$(CC)\""; \
82 echo " #define PLATFORM \"`uname -s`-`uname -m`\""; \
83 echo " #define DATE \"`LC_ALL=C date`\""; \
84 echo "#endif" ) > ${.TARGET}
85
7aa968aa
MD
86openssl/opensslconf.h: openssl/.dummy ../../lib/libcrypto/opensslconf-${MACHINE_ARCH}.h
87 cp ${.ALLSRC:Nopenssl/.dummy} ${.TARGET}
984263bc 88
7aa968aa 89openssl/evp.h: openssl/.dummy ${LCRYPTO_SRC}/crypto/evp/evp.h
984263bc 90.if !defined(MAKE_IDEA) || ${MAKE_IDEA} != YES
7aa968aa 91 sed '/^#ifndef OPENSSL_NO_IDEA$$/,/^#endif$$/d' ${.ALLSRC:Nopenssl/.dummy} > ${.TARGET}
984263bc 92.else
7aa968aa 93 ${INSTALL} -C -m 444 ${.ALLSRC:Nopenssl/.dummy} ${.TARGET}
984263bc
MD
94.endif
95
96SRCS+= ${HDRS:T:S;^;openssl/;}
97.for h in ${HDRS:S/^/${LCRYPTO_SRC}\/crypto\//}
7aa968aa 98openssl/${h:T}: openssl/.dummy ${h}
984263bc
MD
99 ${INSTALL} -C -m 444 ${h} openssl
100.endfor
101
7aa968aa
MD
102# mkdir the required directory as its own target, so multiple
103# mkdir commands do not race against each other.
06bff654 104#
7aa968aa 105openssl/.dummy:
06bff654 106 mkdir -p openssl
7aa968aa 107 if [ ! -f ${.TARGET} ]; then touch ${.TARGET}; fi
06bff654 108
984263bc
MD
109MANDIR= ${SHAREDIR}/openssl/man/man
110
111.if defined(LIB)
112_docs= ${LIB}
113_skip= des_modes
114_sec= 3
115.else
116_docs= apps
117_skip= config
118_sec= 1
119.endif
120
121man-update:
122.for manpage in ${MAN}
123 @(sec=${manpage:E}; \
124 pod=${manpage:R}.pod; \
125 cp ${LCRYPTO_DOC}/${_docs}/$$pod .; \
65b98162 126 pod2man --section=$$sec --release="${OSSLVERSION}" --center="OpenSSL" \
984263bc
MD
127 $$pod > ${.CURDIR}/man/${manpage}; \
128 rm $$pod; \
129 ${ECHO} ${manpage})
130.endfor
131
132man-makefile-update:
133 rm -f ${.CURDIR}/Makefile.man
48720e0e 134 echo '# $$DragonFly: src/secure/lib/libcrypto/Makefile.inc,v 1.7 2004/12/18 20:53:19 asmodai Exp $$' >> ${.CURDIR}/Makefile.man
984263bc
MD
135 echo '# DO NOT EDIT: generated from man-makefile-update target' >> \
136 ${.CURDIR}/Makefile.man
137 for i in ${LCRYPTO_DOC}/${_docs}/*.pod; do \
138 fn=`basename $$i .pod`; \
139 if [ "$$fn" != "${_skip}" ]; then \
140 ${ECHO} "MAN+= $$fn.${_sec}" >> ${.CURDIR}/Makefile.man; \
141 fi; \
142 done
143 for i in ${LCRYPTO_DOC}/${_docs}/*.pod; do \
144 fn=`basename $$i .pod`; \
145 if [ "$$fn" != "${_skip}" ]; then \
146 perl ${LCRYPTO_SRC}/util/extract-names.pl < $$i | \
147 awk "/^$$fn\$$/ { next; } \
148 { print \"MLINKS+= $$fn.${_sec} \" \$$1 \".${_sec}\" }" >> \
149 ${.CURDIR}/Makefile.man; \
150 fi; \
151 done