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