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_CPU:M*i686*} 44#.PATH: ${ZLIBSRC}/contrib/asm686 45#SRCS+= match.S 46#CFLAGS+= -DASMV -DNO_UNDERLINE 47#ACFLAGS+= -Wa,--noexecstack 48#.endif 49 50#.if ${MACHINE_ARCH} == "amd64" 51#.PATH: ${ZLIBSRC}/contrib/gcc_gvmat64 52#SRCS+= gvmat64.S 53#CFLAGS+= -DASMV -DNO_UNDERLINE 54#ACFLAGS+= -Wa,--noexecstack 55#.endif 56 57VERSION_DEF= ${.CURDIR}/Versions.def 58SYMBOL_MAPS= ${.CURDIR}/Symbol.map 59CFLAGS+= -DSYMBOL_VERSIONING 60 61INCS= zconf.h zlib.h 62 63.PATH: ${ZLIBSRC}/test 64 65minigzip: all minigzip.o 66 $(CC) -o minigzip minigzip.o -L. -lz 67 68example: all example.o 69 $(CC) -o example example.o -L. -lz 70 71test: example minigzip 72 (export LD_LIBRARY_PATH=. ; ./example ) 73 (export LD_LIBRARY_PATH=. ; \ 74 echo hello world | ./minigzip | ./minigzip -d ) 75 76FILES= zlib.pc 77FILESDIR= ${LIBDATADIR}/pkgconfig 78 79.include <bsd.lib.mk> 80 81## XXX: clang integrated-as doesn't grok .intel_syntax directives yet 82#ACFLAGS.gvmat64.S= ${CLANG_NO_IAS} 83