xref: /freebsd/secure/lib/libcrypto/Makefile.inc (revision 7aa383846770374466b1dcb2cefd71bde9acf463)
1# $FreeBSD$
2
3.include <bsd.own.mk>
4
5# OpenSSL version used for manual page generation
6OPENSSL_VER=	0.9.8n
7OPENSSL_DATE=	2010-03-24
8
9LCRYPTO_SRC=	${.CURDIR}/../../../crypto/openssl
10LCRYPTO_DOC=	${.CURDIR}/../../../crypto/openssl/doc
11
12CFLAGS+=	-DTERMIOS -DANSI_SOURCE
13CFLAGS+=	-I${LCRYPTO_SRC} -I${LCRYPTO_SRC}/crypto -I${.OBJDIR}
14CFLAGS+=	-DOPENSSL_THREADS -DDSO_DLFCN -DHAVE_DLFCN_H
15
16.if ${MK_IDEA} == "no"
17CFLAGS+=	-DOPENSSL_NO_IDEA
18.endif
19
20.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64"
21CFLAGS+= -DL_ENDIAN
22.endif
23
24MANDIR=	${SHAREDIR}/openssl/man/man
25
26.if defined(LIB)
27_docs=	${LIB}
28_skip=	des_modes
29_sec=	3
30.else
31_docs=	apps
32_skip=	config
33_sec=	1
34.endif
35
36man-update:
37.for manpage in ${MAN}
38	@(sec=${manpage:E}; \
39	pod=${manpage:R}.pod; \
40	cp ${LCRYPTO_DOC}/${_docs}/$$pod .; \
41	pod2man --section=$$sec --release="${OPENSSL_VER}" \
42	  --date="${OPENSSL_DATE}" --center="OpenSSL"  \
43	  $$pod > ${.CURDIR}/man/${manpage}; \
44	rm -f $$pod; \
45	${ECHO} ${manpage})
46.endfor
47
48man-makefile-update:
49	rm -f ${.CURDIR}/Makefile.man
50	echo '# $$'FreeBSD'$$' >> ${.CURDIR}/Makefile.man
51	echo '# DO NOT EDIT: generated from man-makefile-update target' >> \
52	    ${.CURDIR}/Makefile.man
53	for i in ${LCRYPTO_DOC}/${_docs}/*.pod; do \
54		fn=`basename $$i .pod`; \
55		if [ "$$fn" != "${_skip}" ]; then \
56		${ECHO} "MAN+= $$fn.${_sec}" >> ${.CURDIR}/Makefile.man; \
57		fi; \
58	done
59	for i in ${LCRYPTO_DOC}/${_docs}/*.pod; do \
60		fn=`basename $$i .pod`; \
61		if [ "$$fn" != "${_skip}" ]; then \
62		perl ${LCRYPTO_SRC}/util/extract-names.pl < $$i | \
63		  awk "/^$$fn\$$/ { next; } \
64		  { print \"MLINKS+= $$fn.${_sec} \" \$$1 \".${_sec}\" }" >> \
65		  ${.CURDIR}/Makefile.man; \
66		fi; \
67	done
68