-# $OpenBSD: Makefile,v 1.22 2024/01/21 07:33:46 tb Exp $
+# $OpenBSD: Makefile,v 1.23 2024/08/02 04:59:23 tb Exp $
LIB= z
HDRS= zconf.h zlib.h
trees.c uncompr.c zutil.c
MAN= compress.3
+VERSION_SCRIPT= Symbols.map
+SYMBOL_LIST= ${.CURDIR}/Symbols.list
+
+CLEANFILES+= ${VERSION_SCRIPT}
+
PC_FILES=zlib.pc
CLEANFILES+=${PC_FILES}
${INSTALL} ${INSTALL_COPY} -o root -g ${SHAREGRP} \
-m ${SHAREMODE} ${.OBJDIR}/${PC_FILES} ${DESTDIR}/usr/lib/pkgconfig/
+${VERSION_SCRIPT}: ${SYMBOL_LIST}
+ { printf '{\n\tglobal:\n'; \
+ sed '/^[._a-zA-Z]/s/$$/;/; s/^/ /' ${SYMBOL_LIST}; \
+ printf '\n\tlocal:\n\t\t*;\n};\n'; } >$@.tmp && mv $@.tmp $@
+
.include <bsd.lib.mk>