aboutsummaryrefslogtreecommitdiff
path: root/lib/libz/Makefile
blob: fa985cd831bbdb8d83835dae21659338076ec304 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#
# $FreeBSD: src/lib/libz/Makefile,v 1.17.22.2.4.1 2010/12/21 17:09:25 kensmith Exp $
#

LIB=		z
SHLIBDIR?=	/lib
MAN=		zlib.3

#CFLAGS+=	-DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
#CFLAGS+=	-g -DDEBUG
#CFLAGS+=	-Wall -Wwrite-strings -Wpointer-arith -Wconversion \
#		-Wstrict-prototypes -Wmissing-prototypes

CFLAGS+=	-DHAS_snprintf -DHAS_vsnprintf

CLEANFILES+=	example.o example foo.gz minigzip.o minigzip

SRCS = adler32.c compress.c crc32.c gzio.c uncompr.c deflate.c trees.c \
       zutil.c inflate.c inftrees.c inffast.c zopen.c infback.c
INCS=		zconf.h zlib.h

.if ${MACHINE_ARCH} == "i386" && ${MACHINE_CPU:M*i686*}
.PATH:		${.CURDIR}/contrib/asm686
SRCS+=		match.S
CFLAGS+=	-DASMV -DNO_UNDERLINE
.endif

.if ${MACHINE_ARCH} == "amd64"
.PATH:		${.CURDIR}/contrib/gcc_gvmat64
SRCS+=		gvmat64.S
CFLAGS+=	-DASMV -DNO_UNDERLINE
.endif

minigzip:	all minigzip.o
	$(CC) -o minigzip minigzip.o -L. -lz

example:	all example.o
	$(CC) -o example example.o -L. -lz

test: example minigzip
	(export LD_LIBRARY_PATH=. ; ./example )
	(export LD_LIBRARY_PATH=. ; \
		echo hello world | ./minigzip | ./minigzip -d )

.include <bsd.lib.mk>