Switch to OpenSSH-4.1p1.
[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.8 2005/07/07 12:18:28 corecode Exp $
3
4 OSSLVERSION=    0.9.8
5 LCRYPTO_SRC=    ${.CURDIR}/../../../crypto/openssl-0.9
6 LCRYPTO_DOC=    ${LCRYPTO_SRC}/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 .endif
21
22 HDRS+=  \
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         ecdh/ecdh.h \
45         ecdsa/ecdsa.h \
46         engine/eng_int.h engine/engine.h \
47         err/err.h \
48         hmac/hmac.h \
49         ${_idea_h} \
50         krb5/krb5_asn.h \
51         lhash/lhash.h \
52         md2/md2.h \
53         md4/md4.h \
54         md5/md5.h \
55         mdc2/mdc2.h \
56         ocsp/ocsp.h \
57         objects/objects.h objects/obj_mac.h \
58         pem/pem.h pem/pem2.h \
59         pkcs12/pkcs12.h pkcs7/pkcs7.h \
60         pqueue/pqueue.h pqueue/pq_compat.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         store/store.h \
67         sha/sha.h \
68         txt_db/txt_db.h \
69         ui/ui.h ui/ui_compat.h ui/ui_locl.h \
70         x509/x509.h x509/x509_vfy.h x509v3/x509v3.h
71
72 SRCS+=          buildinf.h openssl/opensslconf.h openssl/evp.h
73 CLEANFILES+=    buildinf.h openssl/opensslconf.h openssl/evp.h
74 CLEANDIRS+=     openssl
75
76 buildinf.h:
77         ( echo "#ifndef MK1MF_BUILD"; \
78         echo "  /* auto-generated by crypto/Makefile.ssl for crypto/cversion.c */"; \
79         echo "  #define CFLAGS \"$(CC)\""; \
80         echo "  #define PLATFORM \"`uname -s`-`uname -m`\""; \
81         echo "  #define DATE \"`LC_ALL=C date`\""; \
82         echo "#endif" ) > ${.TARGET}
83
84 openssl/opensslconf.h: openssl/.dummy ../../lib/libcrypto/opensslconf-${MACHINE_ARCH}.h
85         cp ${.ALLSRC:Nopenssl/.dummy} ${.TARGET}
86
87 openssl/evp.h: openssl/.dummy ${LCRYPTO_SRC}/crypto/evp/evp.h
88 .if !defined(MAKE_IDEA) || ${MAKE_IDEA} != YES
89         sed '/^#ifndef OPENSSL_NO_IDEA$$/,/^#endif$$/d' ${.ALLSRC:Nopenssl/.dummy} > ${.TARGET}
90 .else
91         ${INSTALL} -C -m 444 ${.ALLSRC:Nopenssl/.dummy} ${.TARGET}
92 .endif
93
94 SRCS+=  ${HDRS:T:S;^;openssl/;}
95 .for h in ${HDRS:S/^/${LCRYPTO_SRC}\/crypto\//}
96 openssl/${h:T}: openssl/.dummy ${h}
97         ${INSTALL} -C -m 444 ${h} openssl
98 .endfor
99
100 # mkdir the required directory as its own target, so multiple
101 # mkdir commands do not race against each other.
102 #
103 openssl/.dummy:
104         mkdir -p openssl
105         if [ ! -f ${.TARGET} ]; then touch ${.TARGET}; fi
106
107 MANDIR= ${SHAREDIR}/openssl/man/man
108
109 .if defined(LIB)
110 _docs=  ${LIB}
111 _sec=   3
112 .else
113 _docs=  apps
114 _sec=   1
115 .endif
116
117 man-update:
118 .for manpage in ${MAN}
119         @(sec=${manpage:E}; \
120         pod=${manpage:R}.pod; \
121         cp ${LCRYPTO_DOC}/${_docs}/$$pod .; \
122         pod2man --section=$$sec --release="${OSSLVERSION}" --center="OpenSSL" \
123           $$pod > ${.CURDIR}/man/${manpage}; \
124         rm $$pod; \
125         ${ECHO} ${manpage})
126 .endfor
127
128 man-makefile-update:
129         rm -f ${.CURDIR}/Makefile.man
130         echo '# $$''DragonFly$$' >> ${.CURDIR}/Makefile.man
131         echo '# DO NOT EDIT: generated from man-makefile-update target' >> \
132             ${.CURDIR}/Makefile.man
133         for i in ${LCRYPTO_DOC}/${_docs}/*.pod; do \
134                 fn=`basename $$i .pod`; \
135                 sec=`perl ${LCRYPTO_SRC}/util/extract-section.pl < $$i`; \
136                 sec=$${sec:-${_sec}}; \
137                 ${ECHO} "MAN+= $$fn.$$sec" >> ${.CURDIR}/Makefile.man; \
138                 perl ${LCRYPTO_SRC}/util/extract-names.pl < $$i | \
139                   sed -Ee "/^$$fn\$$/d;s/^(.*)/MLINKS+= $$fn.$$sec \1.$$sec/" >> \
140                     ${.CURDIR}/Makefile.man; \
141         done