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