1999-08-27 23:37:10 +00:00
|
|
|
# $FreeBSD$
|
1999-02-09 17:23:03 +00:00
|
|
|
|
1999-10-28 10:34:55 +00:00
|
|
|
GREP_LIBZ=YES
|
1997-12-20 18:46:09 +00:00
|
|
|
|
1999-10-28 10:34:55 +00:00
|
|
|
GREPDIR=${.CURDIR}/../../../contrib/grep
|
|
|
|
|
|
|
|
.PATH: ${GREPDIR}/src ${GREPDIR}/doc
|
1997-12-20 18:46:09 +00:00
|
|
|
|
1993-06-29 06:04:45 +00:00
|
|
|
PROG= grep
|
1999-10-28 10:34:55 +00:00
|
|
|
SRCS= dfa.c getopt.c getopt1.c grep.c kwset.c obstack.c \
|
|
|
|
savedir.c search.c stpcpy.c
|
|
|
|
CFLAGS+=-I${.CURDIR} -DHAVE_CONFIG_H
|
1993-07-06 18:45:26 +00:00
|
|
|
|
1993-07-16 17:48:38 +00:00
|
|
|
LINKS+= ${BINDIR}/grep ${BINDIR}/egrep \
|
|
|
|
${BINDIR}/grep ${BINDIR}/fgrep
|
1993-07-08 16:18:59 +00:00
|
|
|
MLINKS= grep.1 egrep.1 grep.1 fgrep.1
|
1993-07-06 18:45:26 +00:00
|
|
|
|
1995-01-11 05:07:00 +00:00
|
|
|
DPADD+= ${LIBGNUREGEX}
|
|
|
|
LDADD+= -lgnuregex
|
|
|
|
|
1997-12-20 18:46:09 +00:00
|
|
|
.if defined(GREP_LIBZ) && !empty(GREP_LIBZ)
|
|
|
|
LDADD+= -lz
|
|
|
|
DPADD+= ${LIBZ}
|
1999-10-28 10:34:55 +00:00
|
|
|
CFLAGS+=-DHAVE_LIBZ=1
|
1997-12-21 19:15:12 +00:00
|
|
|
LINKS+= ${BINDIR}/grep ${BINDIR}/zgrep \
|
|
|
|
${BINDIR}/grep ${BINDIR}/zegrep \
|
1999-10-28 10:34:55 +00:00
|
|
|
${BINDIR}/grep ${BINDIR}/zfgrep
|
|
|
|
MLINKS+=grep.1 zgrep.1 grep.1 zegrep.1 grep.1 zfgrep.1
|
1997-12-20 18:46:09 +00:00
|
|
|
.endif
|
|
|
|
|
1999-10-28 10:34:55 +00:00
|
|
|
SUBDIR+=doc
|
|
|
|
|
1993-07-08 16:18:59 +00:00
|
|
|
check: all
|
1999-10-28 10:34:55 +00:00
|
|
|
@failed=0; total=0; \
|
|
|
|
for tst in ${TESTS}; do \
|
|
|
|
total=$$(($$total+1)); \
|
|
|
|
if GREP=${.OBJDIR}/${PROG} srcdir=${GREPDIR}/tests \
|
|
|
|
${GREPDIR}/tests/$$tst; then \
|
|
|
|
echo "PASS: $$tst"; \
|
|
|
|
else \
|
|
|
|
failed=$$(($$failed+1)); \
|
|
|
|
echo "FAIL: $$tst"; \
|
|
|
|
fi; \
|
|
|
|
done; \
|
|
|
|
if [ "$$failed" -eq 0 ]; then \
|
|
|
|
echo "All $$total tests passed"; \
|
|
|
|
else \
|
|
|
|
echo "$$failed of $$total tests failed"; \
|
|
|
|
fi
|
|
|
|
|
|
|
|
TESTS= warning.sh khadafy.sh spencer1.sh bre.sh ere.sh \
|
|
|
|
status.sh empty.sh options.sh
|
1993-06-29 06:04:45 +00:00
|
|
|
|
|
|
|
.include <bsd.prog.mk>
|