xref: /freebsd/lib/libz/Makefile (revision 2c221f6f88b69a7e7b631a029905065e5bdeb34a)
1#
2# $FreeBSD$
3#
4
5LIB=		z
6SHLIBDIR?=	/lib
7MAN=		zlib.3
8
9#CFLAGS+=	-DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
10#CFLAGS+=	-g -DDEBUG
11#CFLAGS+=	-Wall -Wwrite-strings -Wpointer-arith -Wconversion \
12#		-Wstrict-prototypes -Wmissing-prototypes
13
14CFLAGS+=	-DHAS_snprintf -DHAS_vsnprintf
15
16CLEANFILES+=	example.o example foo.gz minigzip.o minigzip
17
18SRCS = adler32.c compress.c crc32.c gzio.c uncompr.c deflate.c trees.c \
19       zutil.c inflate.c inftrees.c inffast.c zopen.c infback.c
20INCS=		zconf.h zlib.h
21
22.if ${MACHINE_ARCH} == "i386" && ${MACHINE_CPU:M*i686*}
23.PATH:		${.CURDIR}/contrib/asm686
24SRCS+=		match.S
25CFLAGS+=	-DASMV -DNO_UNDERLINE
26.endif
27
28.if ${MACHINE_ARCH} == "amd64"
29.PATH:		${.CURDIR}/contrib/gcc_gvmat64
30SRCS+=		gvmat64.S
31CFLAGS+=	-DASMV -DNO_UNDERLINE
32.endif
33
34minigzip:	all minigzip.o
35	$(CC) -o minigzip minigzip.o -L. -lz
36
37example:	all example.o
38	$(CC) -o example example.o -L. -lz
39
40test: example minigzip
41	(export LD_LIBRARY_PATH=. ; ./example )
42	(export LD_LIBRARY_PATH=. ; \
43		echo hello world | ./minigzip | ./minigzip -d )
44
45.include <bsd.lib.mk>
46