Deleted Added
full compact
Makefile (275077) Makefile (276551)
1# $FreeBSD: head/gnu/usr.bin/grep/Makefile 275077 2014-11-25 21:18:18Z bapt $
1# $FreeBSD: head/gnu/usr.bin/grep/Makefile 276551 2015-01-02 18:45:03Z bapt $
2
3.include <src.opts.mk>
4
5GREP_LIBZ=YES
6
7.if ${MK_BSD_GREP} != "yes"
8PROG= grep
9.else
10PROG= gnugrep
11.endif
12SRCS= closeout.c dfa.c error.c exclude.c grep.c grepmat.c hard-locale.c \
13 isdir.c kwset.c obstack.c quotearg.c savedir.c search.c xmalloc.c \
14 xstrtoumax.c
15CLEANFILES+= gnugrep.1
16
17CFLAGS+=-I${.CURDIR} -I${DESTDIR}/usr/include/gnu -DHAVE_CONFIG_H
18
19.if ${MK_BSD_GREP} != "yes"
20LINKS+= ${BINDIR}/grep ${BINDIR}/egrep \
21 ${BINDIR}/grep ${BINDIR}/fgrep
22MLINKS= grep.1 egrep.1 grep.1 fgrep.1
23.endif
24
25LIBADD= gnuregex bz2
26
27.if ${MK_BSD_GREP} != "yes"
28LINKS+= ${BINDIR}/grep ${BINDIR}/bzgrep \
29 ${BINDIR}/grep ${BINDIR}/bzegrep \
30 ${BINDIR}/grep ${BINDIR}/bzfgrep
31MLINKS+=grep.1 bzgrep.1 grep.1 bzegrep.1 grep.1 bzfgrep.1
32.endif
33
34.if defined(GREP_LIBZ) && !empty(GREP_LIBZ)
35LIBADD+= z
36CFLAGS+=-DHAVE_LIBZ=1
37.if ${MK_BSD_GREP} != "yes"
38LINKS+= ${BINDIR}/grep ${BINDIR}/zgrep \
39 ${BINDIR}/grep ${BINDIR}/zegrep \
40 ${BINDIR}/grep ${BINDIR}/zfgrep
41MLINKS+=grep.1 zgrep.1 grep.1 zegrep.1 grep.1 zfgrep.1
42.endif
43.endif
44
45gnugrep.1: grep.1
46 cp ${.ALLSRC} ${.TARGET}
47
2
3.include <src.opts.mk>
4
5GREP_LIBZ=YES
6
7.if ${MK_BSD_GREP} != "yes"
8PROG= grep
9.else
10PROG= gnugrep
11.endif
12SRCS= closeout.c dfa.c error.c exclude.c grep.c grepmat.c hard-locale.c \
13 isdir.c kwset.c obstack.c quotearg.c savedir.c search.c xmalloc.c \
14 xstrtoumax.c
15CLEANFILES+= gnugrep.1
16
17CFLAGS+=-I${.CURDIR} -I${DESTDIR}/usr/include/gnu -DHAVE_CONFIG_H
18
19.if ${MK_BSD_GREP} != "yes"
20LINKS+= ${BINDIR}/grep ${BINDIR}/egrep \
21 ${BINDIR}/grep ${BINDIR}/fgrep
22MLINKS= grep.1 egrep.1 grep.1 fgrep.1
23.endif
24
25LIBADD= gnuregex bz2
26
27.if ${MK_BSD_GREP} != "yes"
28LINKS+= ${BINDIR}/grep ${BINDIR}/bzgrep \
29 ${BINDIR}/grep ${BINDIR}/bzegrep \
30 ${BINDIR}/grep ${BINDIR}/bzfgrep
31MLINKS+=grep.1 bzgrep.1 grep.1 bzegrep.1 grep.1 bzfgrep.1
32.endif
33
34.if defined(GREP_LIBZ) && !empty(GREP_LIBZ)
35LIBADD+= z
36CFLAGS+=-DHAVE_LIBZ=1
37.if ${MK_BSD_GREP} != "yes"
38LINKS+= ${BINDIR}/grep ${BINDIR}/zgrep \
39 ${BINDIR}/grep ${BINDIR}/zegrep \
40 ${BINDIR}/grep ${BINDIR}/zfgrep
41MLINKS+=grep.1 zgrep.1 grep.1 zegrep.1 grep.1 zfgrep.1
42.endif
43.endif
44
45gnugrep.1: grep.1
46 cp ${.ALLSRC} ${.TARGET}
47
48SUBDIR+=doc
49
50check: all
51 @failed=0; total=0; \
52 for tst in ${TESTS}; do \
53 total=$$(($$total+1)); \
54 if GREP=${.OBJDIR}/${PROG} srcdir=${.CURDIR}/tests \
55 ${.CURDIR}/tests/$$tst; then \
56 echo "PASS: $$tst"; \
57 else \
58 failed=$$(($$failed+1)); \
59 echo "FAIL: $$tst"; \
60 fi; \
61 done; \
62 if [ "$$failed" -eq 0 ]; then \
63 echo "All $$total tests passed"; \
64 else \
65 echo "$$failed of $$total tests failed"; \
66 fi
67
68TESTS= warning.sh khadafy.sh spencer1.sh bre.sh ere.sh status.sh empty.sh \
69 options.sh backref.sh file.sh
70
71.include <bsd.prog.mk>
48check: all
49 @failed=0; total=0; \
50 for tst in ${TESTS}; do \
51 total=$$(($$total+1)); \
52 if GREP=${.OBJDIR}/${PROG} srcdir=${.CURDIR}/tests \
53 ${.CURDIR}/tests/$$tst; then \
54 echo "PASS: $$tst"; \
55 else \
56 failed=$$(($$failed+1)); \
57 echo "FAIL: $$tst"; \
58 fi; \
59 done; \
60 if [ "$$failed" -eq 0 ]; then \
61 echo "All $$total tests passed"; \
62 else \
63 echo "$$failed of $$total tests failed"; \
64 fi
65
66TESTS= warning.sh khadafy.sh spencer1.sh bre.sh ere.sh status.sh empty.sh \
67 options.sh backref.sh file.sh
68
69.include <bsd.prog.mk>