1# $FreeBSD$ 2 3GREP_LIBZ=YES 4 5PROG= grep 6SRCS= dfa.c getopt.c getopt1.c grep.c kwset.c obstack.c savedir.c search.c \ 7 stpcpy.c 8 9CFLAGS+=-I${.CURDIR} -DHAVE_CONFIG_H 10 11LINKS+= ${BINDIR}/grep ${BINDIR}/egrep \ 12 ${BINDIR}/grep ${BINDIR}/fgrep 13MLINKS= grep.1 egrep.1 grep.1 fgrep.1 14 15DPADD+= ${LIBGNUREGEX} 16DPADD+= ${LIBBZ2} 17LDADD+= -lgnuregex 18LDADD+= -lbz2 19 20LINKS+= ${BINDIR}/grep ${BINDIR}/bzgrep \ 21 ${BINDIR}/grep ${BINDIR}/bzegrep \ 22 ${BINDIR}/grep ${BINDIR}/bzfgrep 23MLINKS+=grep.1 bzgrep.1 grep.1 bzegrep.1 grep.1 bzfgrep.1 24 25.if defined(GREP_LIBZ) && !empty(GREP_LIBZ) 26LDADD+= -lz 27DPADD+= ${LIBZ} 28CFLAGS+=-DHAVE_LIBZ=1 29LINKS+= ${BINDIR}/grep ${BINDIR}/zgrep \ 30 ${BINDIR}/grep ${BINDIR}/zegrep \ 31 ${BINDIR}/grep ${BINDIR}/zfgrep 32MLINKS+=grep.1 zgrep.1 grep.1 zegrep.1 grep.1 zfgrep.1 33.endif 34 35SUBDIR+=doc 36 37check: all 38 @failed=0; total=0; \ 39 for tst in ${TESTS}; do \ 40 total=$$(($$total+1)); \ 41 if GREP=${.OBJDIR}/${PROG} srcdir=${.CURDIR}/tests \ 42 ${.CURDIR}/tests/$$tst; then \ 43 echo "PASS: $$tst"; \ 44 else \ 45 failed=$$(($$failed+1)); \ 46 echo "FAIL: $$tst"; \ 47 fi; \ 48 done; \ 49 if [ "$$failed" -eq 0 ]; then \ 50 echo "All $$total tests passed"; \ 51 else \ 52 echo "$$failed of $$total tests failed"; \ 53 fi 54 55TESTS= warning.sh khadafy.sh spencer1.sh bre.sh ere.sh status.sh empty.sh \ 56 options.sh 57 58.include <bsd.prog.mk> 59