xref: /freebsd/lib/libz/Makefile (revision 0b3105a37d7adcadcb720112fed4dc4e8040be99)
1#
2# $FreeBSD$
3#
4
5LIB=		z
6SHLIBDIR?=	/lib
7SHLIB_MAJOR=	6
8MAN=		zlib.3 zopen.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
40#SRCS+=		match.S
41#CFLAGS+=	-DASMV -DNO_UNDERLINE
42#ACFLAGS+=	-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#.endif
51
52VERSION_DEF=	${.CURDIR}/Versions.def
53SYMBOL_MAPS=	${.CURDIR}/Symbol.map
54CFLAGS+=	-DSYMBOL_VERSIONING
55
56INCS=		zconf.h zlib.h
57
58.PATH:		${.CURDIR}/test
59
60minigzip:	all minigzip.o
61	$(CC) -o minigzip minigzip.o -L. -lz
62
63example:	all example.o
64	$(CC) -o example example.o -L. -lz
65
66test: example minigzip
67	(export LD_LIBRARY_PATH=. ; ./example )
68	(export LD_LIBRARY_PATH=. ; \
69		echo hello world | ./minigzip | ./minigzip -d )
70
71FILES=		zlib.pc
72FILESDIR=	${LIBDATADIR}/pkgconfig
73
74.include <bsd.lib.mk>
75
76## XXX: clang integrated-as doesn't grok .intel_syntax directives yet
77#ACFLAGS.gvmat64.S=	${CLANG_NO_IAS}
78#ACFLAGS+=		${ACFLAGS.${.IMPSRC:T}}
79