1# 2# $FreeBSD$ 3# 4 5PACKAGE=lib${LIB} 6LIB= z 7SHLIBDIR?= /lib 8SHLIB_MAJOR= 6 9MAN= zlib.3 zopen.3 10 11ZLIBSRC= ${SRCTOP}/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+= -DHAS_snprintf -DHAS_vsnprintf -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+= zopen.c 41SRCS+= zutil.c 42 43.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" 44CFLAGS+= -DUNALIGNED_OK 45.endif 46 47VERSION_DEF= ${.CURDIR}/Versions.def 48SYMBOL_MAPS= ${.CURDIR}/Symbol.map 49CFLAGS+= -DSYMBOL_VERSIONING 50 51INCS= zconf.h zlib.h 52 53.PATH: ${ZLIBSRC}/test 54 55minigzip: all minigzip.o 56 $(CC) -o minigzip minigzip.o -L. -lz 57 58example: all example.o 59 $(CC) -o example example.o -L. -lz 60 61test: example minigzip 62 (export LD_LIBRARY_PATH=. ; ./example ) 63 (export LD_LIBRARY_PATH=. ; \ 64 echo hello world | ./minigzip | ./minigzip -d ) 65 66FILES= zlib.pc 67FILESDIR= ${LIBDATADIR}/pkgconfig 68 69.include <bsd.lib.mk> 70 71## XXX: clang integrated-as doesn't grok .intel_syntax directives yet 72#ACFLAGS.gvmat64.S= ${CLANG_NO_IAS} 73