10 MLINKS+= zopen.3 zdopen.3
12 ZLIBSRC= ${SRCTOP}/sys/contrib/zlib
16 #CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
18 #CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
19 # -Wstrict-prototypes -Wmissing-prototypes
21 CFLAGS+= -DHAS_snprintf -DHAS_vsnprintf -I${.CURDIR}
25 CLEANFILES+= example.o example foo.gz minigzip.o minigzip
44 .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64"
45 CFLAGS+= -DUNALIGNED_OK
48 VERSION_DEF= ${.CURDIR}/Versions.def
49 SYMBOL_MAPS= ${.CURDIR}/Symbol.map
50 CFLAGS+= -DSYMBOL_VERSIONING
54 .PATH: ${ZLIBSRC}/test
56 ZLIB_VERSION!= sed -n '/define.*ZLIB_VERSION/{s,[^0-9.],,gp;q;}' ${ZLIBSRC}/zlib.h
59 sed -e 's,@prefix@,/usr,g ; \
60 s,@exec_prefix@,$${prefix},g ; \
61 s,@libdir@,$${exec_prefix}/lib,g ; \
62 s,@sharedlibdir@,$${libdir},g ; \
63 s,@includedir@,$${prefix}/include,g ; \
64 s,@VERSION@,${ZLIB_VERSION},g ;' \
65 ${.ALLSRC} > ${.TARGET}
67 minigzip: all minigzip.o
68 $(CC) -o minigzip minigzip.o -L. -lz
70 example: all example.o
71 $(CC) -o example example.o -L. -lz
73 test: example minigzip
74 (export LD_LIBRARY_PATH=. ; ./example )
75 (export LD_LIBRARY_PATH=. ; \
76 echo hello world | ./minigzip | ./minigzip -d )
79 FILESDIR= ${LIBDATADIR}/pkgconfig