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