Clean up main() arguments.
[dragonfly.git] / secure / lib / libcrypto / Makefile.inc
1 # $FreeBSD: src/secure/lib/libcrypto/Makefile.inc,v 1.7.2.11 2003/02/20 15:07:32 nectar Exp $
2 # $DragonFly: src/secure/lib/libcrypto/Makefile.inc,v 1.7 2004/12/18 20:53:19 asmodai Exp $
3
4 OSSLVERSION=    0.9.7e
5 LCRYPTO_SRC=    ${.CURDIR}/../../../crypto/openssl-${OSSLVERSION}
6 LCRYPTO_DOC=    ${.CURDIR}/../../../crypto/openssl-${OSSLVERSION}/doc
7
8 CFLAGS+=        -DTERMIOS -DANSI_SOURCE
9 CFLAGS+=        -I${LCRYPTO_SRC} -I${LCRYPTO_SRC}/crypto \
10                 -I${LCRYPTO_SRC}/crypto/engine -I${.OBJDIR}
11
12 .if !defined(MAKE_IDEA) || ${MAKE_IDEA} != YES
13 CFLAGS+=        -DOPENSSL_NO_IDEA
14 .else
15 _idea_h=        idea/idea.h
16 .endif
17
18 .if ${MACHINE_ARCH} == "i386"
19 CFLAGS+= -DL_ENDIAN
20 .elif ${MACHINE_ARCH} == "alpha"
21 # no ENDIAN stuff defined for alpha (64-bit)
22 .endif
23
24 HDRS+=  \
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 \
51         ../fips/fips.h ../fips/rand/fips_rand.h \
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
74 SRCS+=          buildinf.h openssl/opensslconf.h openssl/evp.h
75 CLEANFILES+=    buildinf.h openssl/opensslconf.h openssl/evp.h
76 CLEANDIRS+=     openssl
77
78 buildinf.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
86 openssl/opensslconf.h: openssl/.dummy ../../lib/libcrypto/opensslconf-${MACHINE_ARCH}.h
87         cp ${.ALLSRC:Nopenssl/.dummy} ${.TARGET}
88
89 openssl/evp.h: openssl/.dummy ${LCRYPTO_SRC}/crypto/evp/evp.h
90 .if !defined(MAKE_IDEA) || ${MAKE_IDEA} != YES
91         sed '/^#ifndef OPENSSL_NO_IDEA$$/,/^#endif$$/d' ${.ALLSRC:Nopenssl/.dummy} > ${.TARGET}
92 .else
93         ${INSTALL} -C -m 444 ${.ALLSRC:Nopenssl/.dummy} ${.TARGET}
94 .endif
95
96 SRCS+=  ${HDRS:T:S;^;openssl/;}
97 .for h in ${HDRS:S/^/${LCRYPTO_SRC}\/crypto\//}
98 openssl/${h:T}: openssl/.dummy ${h}
99         ${INSTALL} -C -m 444 ${h} openssl
100 .endfor
101
102 # mkdir the required directory as its own target, so multiple
103 # mkdir commands do not race against each other.
104 #
105 openssl/.dummy:
106         mkdir -p openssl
107         if [ ! -f ${.TARGET} ]; then touch ${.TARGET}; fi
108
109 MANDIR= ${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
121 man-update:
122 .for manpage in ${MAN}
123         @(sec=${manpage:E}; \
124         pod=${manpage:R}.pod; \
125         cp ${LCRYPTO_DOC}/${_docs}/$$pod .; \
126         pod2man --section=$$sec --release="${OSSLVERSION}" --center="OpenSSL" \
127           $$pod > ${.CURDIR}/man/${manpage}; \
128         rm $$pod; \
129         ${ECHO} ${manpage})
130 .endfor
131
132 man-makefile-update:
133         rm -f ${.CURDIR}/Makefile.man
134         echo '# $$DragonFly: src/secure/lib/libcrypto/Makefile.inc,v 1.7 2004/12/18 20:53:19 asmodai Exp $$' >> ${.CURDIR}/Makefile.man
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