58362eb7f39f08efb12cdf0bf06e78bb36784f8f
[dragonfly.git] / secure / lib / libcrypto / Makefile.inc
1 OSSLVERSION=    1.0.1h
2 OSSLDATE=       2014-06-05
3 LCRYPTO_SRC=    ${.CURDIR}/../../../crypto/openssl
4 LCRYPTO_DOC=    ${LCRYPTO_SRC}/doc
5
6 CFLAGS+=        -DDSO_DLFCN -DHAVE_DLFCN_H -DL_ENDIAN -DTERMIOS
7 CFLAGS+=        -DOPENSSL_THREADS
8 CFLAGS+=        -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT \
9                 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM \
10                 -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM \
11                 -DWHIRLPOOL_ASM -DGHASH_ASM
12 .if ${MACHINE_ARCH} == "i386"
13 CFLAGS+=        -DOPENSSL_BN_ASM_PART_WORDS -DRMD160_ASM
14 .elif ${MACHINE_ARCH} == "x86_64"
15 CFLAGS+=        -DOPENSSL_BN_ASM_MONT5 -DBSAES_ASM
16 .endif
17 CFLAGS+=        -I${LCRYPTO_SRC} -I${LCRYPTO_SRC}/crypto \
18                 -I${LCRYPTO_SRC}/crypto/asn1 -I${LCRYPTO_SRC}/crypto/evp \
19                 -I${LCRYPTO_SRC}/crypto/modes \
20                 -I${LCRYPTO_SRC}/crypto/engine -I${.OBJDIR}
21
22 MANDIR= ${SHAREDIR}/openssl/man/man
23
24 .if defined(LIB)
25 _docs=  ${LIB}
26 _sec=   3
27 .else
28 _docs=  apps
29 _sec=   1
30 .endif
31
32 man-update:
33 .for manpage in ${MAN}
34         @(sec=${manpage:E}; \
35         pod=${manpage:R}.pod; \
36         cp ${LCRYPTO_DOC}/${_docs}/$$pod .; \
37         pod2man --section=$$sec --release="${OSSLVERSION}" \
38           --date="${OSSLDATE}" --center="OpenSSL" \
39           $$pod > ${.CURDIR}/man/${manpage}; \
40         rm $$pod; \
41         ${ECHO} ${manpage})
42 .endfor
43
44 man-makefile-update:
45         rm -f ${.CURDIR}/Makefile.man
46         echo '# DO NOT EDIT: generated from man-makefile-update target' >> \
47             ${.CURDIR}/Makefile.man
48         for i in ${LCRYPTO_DOC}/${_docs}/*.pod; do \
49                 fn=`basename $$i .pod`; \
50                 sec=`perl ${LCRYPTO_SRC}/util/extract-section.pl < $$i`; \
51                 sec=$${sec:-${_sec}}; \
52                 ${ECHO} "MAN+= $$fn.$$sec" >> ${.CURDIR}/Makefile.man; \
53                 perl ${LCRYPTO_SRC}/util/extract-names.pl < $$i | \
54                   sed -Ee "/^$$fn\$$/d;s/^(.*)/MLINKS+= $$fn.$$sec \1.$$sec/" >> \
55                     ${.CURDIR}/Makefile.man; \
56         done