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