]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - lib/libz/Makefile
libpcap: Update to 1.10.4
[FreeBSD/FreeBSD.git] / lib / libz / Makefile
1 #
2 # $FreeBSD$
3 #
4
5 PACKAGE=        runtime
6 LIB=            z
7 SHLIBDIR?=      /lib
8 SHLIB_MAJOR=    6
9 MAN=            zlib.3 zopen.3
10 MLINKS+=        zopen.3 zdopen.3
11
12 ZLIBSRC=        ${SRCTOP}/sys/contrib/zlib
13
14 .PATH:          ${ZLIBSRC}
15
16 #CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
17 #CFLAGS=-g -DDEBUG
18 #CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
19 #           -Wstrict-prototypes -Wmissing-prototypes
20
21 CFLAGS+=        -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN -I${.CURDIR}
22
23 WARNS?=         3
24
25 CLEANFILES+=    example.o example foo.gz minigzip.o minigzip
26
27 SRCS+=          adler32.c
28 SRCS+=          compress.c
29 SRCS+=          crc32.c
30 SRCS+=          deflate.c
31 SRCS+=          gzclose.c
32 SRCS+=          gzlib.c
33 SRCS+=          gzread.c
34 SRCS+=          gzwrite.c
35 SRCS+=          infback.c
36 SRCS+=          inffast.c
37 SRCS+=          inflate.c
38 SRCS+=          inftrees.c
39 SRCS+=          trees.c
40 SRCS+=          uncompr.c
41 SRCS+=          zutil.c
42
43 # Wrapper relies on FreeBSD-specific fpos_t representation and non-portable
44 # funopen. Not needed for bootstrapping, so just disable it.
45 .if ${.MAKE.OS} == "FreeBSD" || !defined(BOOTSTRAPPING)
46 SRCS+=          zopen.c
47 .endif
48
49 .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64"
50 CFLAGS+=        -DUNALIGNED_OK
51 .endif
52
53 VERSION_DEF=    ${.CURDIR}/Versions.def
54 SYMBOL_MAPS=    ${.CURDIR}/Symbol.map
55 CFLAGS+=        -DSYMBOL_VERSIONING
56
57 INCS=           zconf.h zlib.h
58
59 .PATH:          ${ZLIBSRC}/test
60
61 ZLIB_VERSION!=  sed -n '/define.*ZLIB_VERSION/{s,[^0-9.],,gp;q;}' ${ZLIBSRC}/zlib.h
62
63 zlib.pc: zlib.pc.in
64         sed -e 's,@prefix@,/usr,g ; \
65                 s,@exec_prefix@,$${prefix},g ; \
66                 s,@libdir@,${LIBDIR},g ; \
67                 s,@sharedlibdir@,${SHLIBDIR},g ; \
68                 s,@includedir@,${INCLUDEDIR},g ; \
69                 s,@VERSION@,${ZLIB_VERSION},g ;' \
70                 ${.ALLSRC} > ${.TARGET}
71
72 minigzip:       all minigzip.o
73         $(CC) -o minigzip minigzip.o -L. -lz
74
75 example:        all example.o
76         $(CC) -o example example.o -L. -lz
77
78 test: example minigzip
79         (export LD_LIBRARY_PATH=. ; ./example )
80         (export LD_LIBRARY_PATH=. ; \
81                 echo hello world | ./minigzip | ./minigzip -d )
82
83 PCFILES=        zlib.pc
84
85 .include <bsd.lib.mk>
86
87 CWARNFLAGS+=    ${NO_WDEPRECATED_NON_PROTOTYPE} ${NO_WSTRICT_PROTOTYPES}