xref: /freebsd/lib/libz/Makefile (revision fcb560670601b2a4d87bb31d7531c8dcc37ee71b)
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
71.ifndef COMPAT_32BIT
72beforeinstall:
73	${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
74		${.CURDIR}/zlib.pc ${DESTDIR}${LIBDATADIR}/pkgconfig
75.endif
76
77.include <bsd.lib.mk>
78
79## XXX: clang integrated-as doesn't grok .intel_syntax directives yet
80#ACFLAGS.gvmat64.S=	${CLANG_NO_IAS}
81#ACFLAGS+=		${ACFLAGS.${.IMPSRC:T}}
82