Home | History | Annotate | Line # | Download | only in zcat
      1 # $NetBSD: Makefile,v 1.21 2023/06/03 09:09:02 lukem Exp $
      2 # Small zcat (i.e. for install media)
      3 #
      4 
      5 NOSSP=yes
      6 NOMAN=
      7 .include <bsd.own.mk>
      8 
      9 SRCDIR=		${.CURDIR}/../../../common/dist/zlib
     10 LIBC=		${NETBSDSRCDIR}/lib/libc
     11 
     12 .PATH:		${SRCDIR} ${LIBC}/stdlib
     13 
     14 WARNS?=		4
     15 PROG=		zcat
     16 
     17 # Just what we need from libz
     18 SRCS=		zcat.c gzread.c gzclose.c gzlib.c inflate.c 
     19 SRCS+=		adler32.c crc32.c zutil.c inffast.c inftrees.c
     20 CPPFLAGS+=	-I${SRCDIR} -DNO_GZCOMPRESS
     21 
     22 # This avoids including stdio, threads, locale, etc.
     23 SRCS+=		misc.c
     24 SRCS+=		malloc.c	# small
     25 CPPFLAGS+=	-I${LIBC}/include
     26 CPPFLAGS+=	-Dsnprintf=snprintf_ss -Dsprintf=sprintf_ss
     27 CPPFLAGS+=	-Dstrerror=strerror_ss
     28 
     29 COPTS.inflate.c+=	${CC_WNO_IMPLICIT_FALLTHROUGH}
     30 
     31 .include <bsd.prog.mk>
     32 
     33 test: zcat
     34 	echo 'hello, hello!' | gzip | ./zcat
     35