Add the DragonFly cvs id and perform general cleanups on cvs/rcs/sccs ids. Most
[dragonfly.git] / gnu / usr.bin / grep / Makefile
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.2 2003/06/17 04:25:45 dillon Exp $
3
4 GREP_LIBZ=YES
5
6 PROG=   grep
7 SRCS=   dfa.c getopt.c getopt1.c grep.c kwset.c obstack.c savedir.c search.c \
8         stpcpy.c
9
10 CFLAGS+=-I${.CURDIR} -DHAVE_CONFIG_H
11
12 LINKS+= ${BINDIR}/grep ${BINDIR}/egrep \
13         ${BINDIR}/grep ${BINDIR}/fgrep
14 MLINKS= grep.1 egrep.1 grep.1 fgrep.1
15
16 DPADD+= ${LIBGNUREGEX}
17 LDADD+= -lgnuregex
18
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
28
29 SUBDIR+=doc
30
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"; \
47         fi
48
49 TESTS=  warning.sh khadafy.sh spencer1.sh bre.sh ere.sh status.sh empty.sh \
50         options.sh
51
52 .include <bsd.prog.mk>