1# 2# 3 4PACKAGE= runtime 5LIB= z 6SHLIBDIR?= /lib 7SHLIB_MAJOR= 6 8MAN= zlib.3 zopen.3 9MLINKS+= zopen.3 zdopen.3 10 11ZLIBSRC= ${SRCTOP}/sys/contrib/zlib 12 13.PATH: ${ZLIBSRC} 14 15#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7 16#CFLAGS=-g -DDEBUG 17#CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \ 18# -Wstrict-prototypes -Wmissing-prototypes 19 20CFLAGS+= -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN -I${.CURDIR} 21 22WARNS?= 3 23 24CLEANFILES+= example.o example foo.gz minigzip.o minigzip 25 26SRCS+= adler32.c 27SRCS+= compress.c 28SRCS+= crc32.c 29SRCS+= deflate.c 30SRCS+= gzclose.c 31SRCS+= gzlib.c 32SRCS+= gzread.c 33SRCS+= gzwrite.c 34SRCS+= infback.c 35SRCS+= inffast.c 36SRCS+= inflate.c 37SRCS+= inftrees.c 38SRCS+= trees.c 39SRCS+= uncompr.c 40SRCS+= zutil.c 41 42# Wrapper relies on FreeBSD-specific fpos_t representation and non-portable 43# funopen. Not needed for bootstrapping, so just disable it. 44.if ${.MAKE.OS} == "FreeBSD" || !defined(BOOTSTRAPPING) 45SRCS+= zopen.c 46.endif 47 48.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" 49CFLAGS+= -DUNALIGNED_OK 50.endif 51 52VERSION_DEF= ${.CURDIR}/Versions.def 53SYMBOL_MAPS= ${.CURDIR}/Symbol.map 54CFLAGS+= -DSYMBOL_VERSIONING 55 56INCS= zconf.h zlib.h 57 58.PATH: ${ZLIBSRC}/test 59 60ZLIB_VERSION!= sed -n '/define.*ZLIB_VERSION/{s,[^0-9.],,gp;q;}' ${ZLIBSRC}/zlib.h 61 62zlib.pc: zlib.pc.in 63 sed -e 's,@prefix@,/usr,g ; \ 64 s,@exec_prefix@,$${prefix},g ; \ 65 s,@libdir@,${LIBDIR},g ; \ 66 s,@sharedlibdir@,${SHLIBDIR},g ; \ 67 s,@includedir@,${INCLUDEDIR},g ; \ 68 s,@VERSION@,${ZLIB_VERSION},g ;' \ 69 ${.ALLSRC} > ${.TARGET} 70 71minigzip: all minigzip.o 72 $(CC) -o minigzip minigzip.o -L. -lz 73 74example: all example.o 75 $(CC) -o example example.o -L. -lz 76 77test: example minigzip 78 (export LD_LIBRARY_PATH=. ; ./example ) 79 (export LD_LIBRARY_PATH=. ; \ 80 echo hello world | ./minigzip | ./minigzip -d ) 81 82PCFILES= zlib.pc 83 84.include <bsd.lib.mk> 85 86CWARNFLAGS+= ${NO_WDEPRECATED_NON_PROTOTYPE} ${NO_WSTRICT_PROTOTYPES} 87