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