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+= -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN -I${.CURDIR}
25 CLEANFILES+= example.o example foo.gz minigzip.o minigzip
43 # Wrapper relies on FreeBSD-specific fpos_t representation and non-portable
44 # funopen. Not needed for bootstrapping, so just disable it.
45 .if ${.MAKE.OS} == "FreeBSD" || !defined(BOOTSTRAPPING)
49 .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64"
50 CFLAGS+= -DUNALIGNED_OK
53 VERSION_DEF= ${.CURDIR}/Versions.def
54 SYMBOL_MAPS= ${.CURDIR}/Symbol.map
55 CFLAGS+= -DSYMBOL_VERSIONING
59 .PATH: ${ZLIBSRC}/test
61 ZLIB_VERSION!= sed -n '/define.*ZLIB_VERSION/{s,[^0-9.],,gp;q;}' ${ZLIBSRC}/zlib.h
64 sed -e 's,@prefix@,/usr,g ; \
65 s,@exec_prefix@,$${prefix},g ; \
66 s,@libdir@,$${exec_prefix}/lib,g ; \
67 s,@sharedlibdir@,$${libdir},g ; \
68 s,@includedir@,$${prefix}/include,g ; \
69 s,@VERSION@,${ZLIB_VERSION},g ;' \
70 ${.ALLSRC} > ${.TARGET}
72 minigzip: all minigzip.o
73 $(CC) -o minigzip minigzip.o -L. -lz
75 example: all example.o
76 $(CC) -o example example.o -L. -lz
78 test: example minigzip
79 (export LD_LIBRARY_PATH=. ; ./example )
80 (export LD_LIBRARY_PATH=. ; \
81 echo hello world | ./minigzip | ./minigzip -d )