1# $OpenBSD: Makefile,v 1.25 2016/11/05 08:12:22 jsing Exp $ 2 3SUBDIR= man 4PC_FILES=openssl.pc libssl.pc 5 6CLEANFILES=${PC_FILES} ${VERSION_SCRIPT} 7 8LIB= ssl 9 10.include <bsd.own.mk> 11CFLAGS+= -Wall -Wundef 12.if ${COMPILER_VERSION:L} != "gcc3" 13CFLAGS+= -Werror 14.endif 15CFLAGS+= -DLIBRESSL_INTERNAL 16CFLAGS+= -I${.CURDIR} 17 18LDADD+= -L${BSDOBJDIR}/lib/libcrypto -lcrypto 19 20VERSION_SCRIPT= Symbols.map 21SYMBOL_LIST= ${.CURDIR}/Symbols.list 22 23SRCS=\ 24 s3_srvr.c s3_clnt.c s3_lib.c s3_pkt.c s3_both.c \ 25 s23_srvr.c s23_clnt.c s23_lib.c s23_pkt.c \ 26 t1_meth.c t1_srvr.c t1_clnt.c t1_lib.c t1_enc.c \ 27 d1_meth.c d1_srvr.c d1_clnt.c d1_lib.c d1_pkt.c \ 28 d1_both.c d1_enc.c d1_srtp.c \ 29 ssl_lib.c ssl_err2.c ssl_cert.c ssl_sess.c \ 30 ssl_ciph.c ssl_stat.c ssl_rsa.c \ 31 ssl_asn1.c ssl_txt.c ssl_algs.c \ 32 bio_ssl.c ssl_err.c t1_reneg.c \ 33 pqueue.c 34SRCS+= s3_cbc.c 35SRCS+= bs_ber.c bs_cbb.c bs_cbs.c 36 37HDRS= srtp.h ssl.h ssl2.h ssl3.h ssl23.h tls1.h dtls1.h 38 39.PATH: ${.CURDIR} 40 41includes: 42 @test -d ${DESTDIR}/usr/include/openssl || \ 43 mkdir ${DESTDIR}/usr/include/openssl 44 @cd ${.CURDIR}; for i in $(HDRS); do \ 45 j="cmp -s $$i ${DESTDIR}/usr/include/openssl/`basename $$i` || \ 46 ${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} -m 444 $$i\ 47 ${DESTDIR}/usr/include/openssl"; \ 48 echo $$j; \ 49 eval "$$j"; \ 50 done; 51 52${VERSION_SCRIPT}: ${SYMBOL_LIST} 53 { printf '{\n\tglobal:\n'; \ 54 sed '/^[._a-zA-Z]/s/$$/;/; s/^/ /' ${SYMBOL_LIST}; \ 55 printf '\n\tlocal:\n\t\t*;\n};\n'; } >$@.tmp && mv $@.tmp $@ 56 57.include <bsd.lib.mk> 58 59all: ${PC_FILES} 60${PC_FILES}: ${.CURDIR}/../libcrypto/opensslv.h 61 /bin/sh ${.CURDIR}/generate_pkgconfig.sh -c ${.CURDIR} -o ${.OBJDIR} 62 63beforeinstall: 64 nm -o lib${LIB}.a | egrep -w 'printf|fprintf' && \ 65 (echo please fix stdio usage in this library; false) || true 66.for p in ${PC_FILES} 67 ${INSTALL} ${INSTALL_COPY} -o root -g ${SHAREGRP} \ 68 -m ${SHAREMODE} ${.OBJDIR}/$p ${DESTDIR}/usr/lib/pkgconfig/ 69.endfor 70 71.include <bsd.prog.mk> 72.include <bsd.subdir.mk> 73