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