117653Speter#
2237410Sdelphij# $FreeBSD: head/lib/libz/Makefile 232263 2012-02-28 18:30:18Z dim $
317653Speter#
417653Speter
517653SpeterLIB=		z
6119017SgordonSHLIBDIR?=	/lib
7205471SdelphijSHLIB_MAJOR=	6
874870SruMAN=		zlib.3
917653Speter
10312375SdelphijZLIBSRC=	${SRCTOP}/contrib/zlib
11312375Sdelphij
12312375Sdelphij.PATH:		${ZLIBSRC}
13312375Sdelphij
14205471Sdelphij#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
15205471Sdelphij#CFLAGS=-g -DDEBUG
16205471Sdelphij#CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
17205471Sdelphij#           -Wstrict-prototypes -Wmissing-prototypes
1817653Speter
19205471SdelphijCFLAGS+=	-DHAS_snprintf -DHAS_vsnprintf -I${.CURDIR}
2069653Sjedgar
21201381SedWARNS?=		3
22201381Sed
2333912SsteveCLEANFILES+=	example.o example foo.gz minigzip.o minigzip
2417653Speter
25205471SdelphijSRCS+=		adler32.c
26205471SdelphijSRCS+=		compress.c
27205471SdelphijSRCS+=		crc32.c
28205471SdelphijSRCS+=		deflate.c
29205471SdelphijSRCS+=		gzclose.c
30205471SdelphijSRCS+=		gzlib.c
31205471SdelphijSRCS+=		gzread.c
32205471SdelphijSRCS+=		gzwrite.c
33205471SdelphijSRCS+=		infback.c
34205471SdelphijSRCS+=		inffast.c
35205471SdelphijSRCS+=		inflate.c
36205471SdelphijSRCS+=		inftrees.c
37205471SdelphijSRCS+=		trees.c
38205471SdelphijSRCS+=		uncompr.c
39205471SdelphijSRCS+=		zopen.c
40205471SdelphijSRCS+=		zutil.c
41205471Sdelphij
42319288Sdelphij.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64"
43319283SdelphijCFLAGS+=	-DUNALIGNED_OK
44319283Sdelphij.endif
45205471Sdelphij
46205471SdelphijVERSION_DEF=	${.CURDIR}/Versions.def
47205471SdelphijSYMBOL_MAPS=	${.CURDIR}/Symbol.map
48205471SdelphijCFLAGS+=	-DSYMBOL_VERSIONING
49205471Sdelphij
5055955SrgrimesINCS=		zconf.h zlib.h
5117653Speter
52312375Sdelphij.PATH:		${ZLIBSRC}/test
53268047Sdelphij
5417653Speterminigzip:	all minigzip.o
5517653Speter	$(CC) -o minigzip minigzip.o -L. -lz
5617653Speter
5717653Speterexample:	all example.o
5817653Speter	$(CC) -o example example.o -L. -lz
5917653Speter
6017653Spetertest: example minigzip
6117653Speter	(export LD_LIBRARY_PATH=. ; ./example )
6217653Speter	(export LD_LIBRARY_PATH=. ; \
6317653Speter		echo hello world | ./minigzip | ./minigzip -d )
6417653Speter
65288610Sbdrewery.ifndef COMPAT_32BIT
66288610SbdreweryFILES=		zlib.pc
67288610SbdreweryFILESDIR=	${LIBDATADIR}/pkgconfig
68288610Sbdrewery.endif
69268902Sbapt
7017653Speter.include <bsd.lib.mk>
71232263Sdim
72232263Sdim## XXX: clang integrated-as doesn't grok .intel_syntax directives yet
73232263Sdim#ACFLAGS.gvmat64.S=	${CLANG_NO_IAS}
74232263Sdim#ACFLAGS+=		${ACFLAGS.${.IMPSRC:T}}
75