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