Makefile revision 1.19
1# $NetBSD: Makefile,v 1.19 2019/09/29 23:44:58 mrg Exp $
2# Small zcat (i.e. for install media)
3#
4
5NOSSP=yes
6NOMAN=
7.include <bsd.own.mk>
8
9SRCDIR=		${.CURDIR}/../../../common/dist/zlib
10LIBC=		${NETBSDSRCDIR}/lib/libc
11
12.PATH:		${SRCDIR} ${LIBC}/stdlib
13
14WARNS?=		4
15PROG=		zcat
16
17# Just what we need from libz
18SRCS=		zcat.c gzread.c gzclose.c gzlib.c inflate.c 
19SRCS+=		adler32.c crc32.c zutil.c inffast.c inftrees.c
20CPPFLAGS+=	-I${SRCDIR} -DNO_GZCOMPRESS
21
22# This avoids including stdio, threads, locale, etc.
23SRCS+=		misc.c
24SRCS+=		malloc.c	# small
25CPPFLAGS+=	-I${LIBC}/include
26CPPFLAGS+=	-Dsnprintf=snprintf_ss -Dsprintf=sprintf_ss
27CPPFLAGS+=	-Dstrerror=strerror_ss
28
29.if defined(HAVE_GCC) && ${HAVE_GCC} >= 7 && ${ACTIVE_CC} == "gcc"
30COPTS.inflate.c+=	-Wno-error=implicit-fallthrough
31.endif
32
33.include <bsd.prog.mk>
34
35test: zcat
36	echo 'hello, hello!' | gzip | ./zcat
37