1# $NetBSD: Makefile,v 1.4 2011/02/16 01:31:33 joerg Exp $ 2# $FreeBSD$ 3# $OpenBSD: Makefile,v 1.6 2003/06/25 15:00:04 millert Exp $ 4 5.include <src.opts.mk> 6 7.if ${MK_BSD_GREP} == "yes" 8PROG= grep 9MAN1= grep.1 zgrep.1 10.else 11PROG= bsdgrep 12CLEANFILES+= bsdgrep.1 13MAN1= bsdgrep.1 zgrep.1 14 15bsdgrep.1: grep.1 16 ${CP} ${.ALLSRC} ${.TARGET} 17.endif 18SRCS= file.c grep.c queue.c util.c 19 20SCRIPTS= zgrep.sh 21LINKS= ${BINDIR}/zgrep ${BINDIR}/zfgrep \ 22 ${BINDIR}/zgrep ${BINDIR}/zegrep \ 23 ${BINDIR}/zgrep ${BINDIR}/bzgrep \ 24 ${BINDIR}/zgrep ${BINDIR}/bzegrep \ 25 ${BINDIR}/zgrep ${BINDIR}/bzfgrep \ 26 ${BINDIR}/zgrep ${BINDIR}/lzgrep \ 27 ${BINDIR}/zgrep ${BINDIR}/lzegrep \ 28 ${BINDIR}/zgrep ${BINDIR}/lzfgrep \ 29 ${BINDIR}/zgrep ${BINDIR}/xzgrep \ 30 ${BINDIR}/zgrep ${BINDIR}/xzegrep \ 31 ${BINDIR}/zgrep ${BINDIR}/xzfgrep \ 32 ${BINDIR}/zgrep ${BINDIR}/zstdgrep \ 33 ${BINDIR}/zgrep ${BINDIR}/zstdegrep \ 34 ${BINDIR}/zgrep ${BINDIR}/zstdegrep 35 36MLINKS= zgrep.1 zfgrep.1 \ 37 zgrep.1 zegrep.1 \ 38 zgrep.1 bzgrep.1 \ 39 zgrep.1 bzegrep.1 \ 40 zgrep.1 bzfgrep.1 \ 41 zgrep.1 lzgrep.1 \ 42 zgrep.1 lzegrep.1 \ 43 zgrep.1 lzfgrep.1 \ 44 zgrep.1 xzgrep.1 \ 45 zgrep.1 xzegrep.1 \ 46 zgrep.1 xzfgrep.1 \ 47 zgrep.1 zstdgrep.1 \ 48 zgrep.1 zstdegrep.1 \ 49 zgrep.1 zstdfgrep.1 50 51CFLAGS.gcc+= --param max-inline-insns-single=500 52 53.if ${MK_BSD_GREP} == "yes" 54LINKS+= ${BINDIR}/grep ${BINDIR}/egrep \ 55 ${BINDIR}/grep ${BINDIR}/fgrep \ 56 ${BINDIR}/grep ${BINDIR}/rgrep \ 57 58MLINKS+= grep.1 egrep.1 \ 59 grep.1 fgrep.1 \ 60 grep.1 rgrep.1 61.endif 62 63.if ${MK_GNU_GREP_COMPAT} != "no" 64CFLAGS+= -I${SYSROOT:U${DESTDIR}}/usr/include/gnu -DWITH_GNU 65LIBADD+= gnuregex 66.endif 67 68HAS_TESTS= 69SUBDIR.${MK_TESTS}+= tests 70 71.include <bsd.prog.mk> 72