HAMMER 61F2/Many: Fix bug in last commit
[dragonfly.git] / gnu / usr.bin / grep / Makefile
blob1087d946bdb1f4327c1623bca80fbac6c5a1b793
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 $
4 GREP_LIBZ=YES
6 PROG= grep
7 SRCS= dfa.c getopt.c getopt1.c grep.c kwset.c obstack.c savedir.c search.c \
8 stpcpy.c
10 CFLAGS+=-I${.CURDIR} -DHAVE_CONFIG_H
12 LINKS+= ${BINDIR}/grep ${BINDIR}/egrep \
13 ${BINDIR}/grep ${BINDIR}/fgrep
14 MLINKS= grep.1 egrep.1 grep.1 fgrep.1
16 DPADD+= ${LIBGNUREGEX}
17 LDADD+= -lgnuregex
19 .if defined(GREP_LIBZ) && !empty(GREP_LIBZ)
20 LDADD+= -lz
21 DPADD+= ${LIBZ}
22 CFLAGS+=-DHAVE_LIBZ=1
23 LINKS+= ${BINDIR}/grep ${BINDIR}/zgrep \
24 ${BINDIR}/grep ${BINDIR}/zegrep \
25 ${BINDIR}/grep ${BINDIR}/zfgrep
26 MLINKS+=grep.1 zgrep.1 grep.1 zegrep.1 grep.1 zfgrep.1
27 .endif
29 SUBDIR+=doc
31 check: 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"; \
49 TESTS= warning.sh khadafy.sh spencer1.sh bre.sh ere.sh status.sh empty.sh \
50 options.sh
52 .include <bsd.prog.mk>