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