1# 2# $FreeBSD$ 3# 4 5PACKAGE=lib${LIB} 6LIB= z 7SHLIBDIR?= /lib 8SHLIB_MAJOR= 6 9MAN= zlib.3 zopen.3 10MLINKS+= zopen.3 zdopen.3 11 12ZLIBSRC= ${SRCTOP}/sys/contrib/zlib 13 14.PATH: ${ZLIBSRC} 15 16#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7 17#CFLAGS=-g -DDEBUG 18#CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \ 19# -Wstrict-prototypes -Wmissing-prototypes 20 21CFLAGS+= -DHAS_snprintf -DHAS_vsnprintf -I${.CURDIR} 22 23WARNS?= 3 24 25CLEANFILES+= example.o example foo.gz minigzip.o minigzip 26 27SRCS+= adler32.c 28SRCS+= compress.c 29SRCS+= crc32.c 30SRCS+= deflate.c 31SRCS+= gzclose.c 32SRCS+= gzlib.c 33SRCS+= gzread.c 34SRCS+= gzwrite.c 35SRCS+= infback.c 36SRCS+= inffast.c 37SRCS+= inflate.c 38SRCS+= inftrees.c 39SRCS+= trees.c 40SRCS+= uncompr.c 41SRCS+= zopen.c 42SRCS+= zutil.c 43 44.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" 45CFLAGS+= -DUNALIGNED_OK 46.endif 47 48VERSION_DEF= ${.CURDIR}/Versions.def 49SYMBOL_MAPS= ${.CURDIR}/Symbol.map 50CFLAGS+= -DSYMBOL_VERSIONING 51 52INCS= zconf.h zlib.h 53 54.PATH: ${ZLIBSRC}/test 55 56minigzip: all minigzip.o 57 $(CC) -o minigzip minigzip.o -L. -lz 58 59example: all example.o 60 $(CC) -o example example.o -L. -lz 61 62test: example minigzip 63 (export LD_LIBRARY_PATH=. ; ./example ) 64 (export LD_LIBRARY_PATH=. ; \ 65 echo hello world | ./minigzip | ./minigzip -d ) 66 67FILES= zlib.pc 68FILESDIR= ${LIBDATADIR}/pkgconfig 69 70.include <bsd.lib.mk> 71 72## XXX: clang integrated-as doesn't grok .intel_syntax directives yet 73#ACFLAGS.gvmat64.S= ${CLANG_NO_IAS} 74