The current default is provided in various Makefile.inc in some top-level directories and covers a good portion of the tree, but doesn't cover parts of the build a little deeper (e.g. libcasper). Provide a default in src.sys.mk and set WARNS to it in bsd.sys.mk if that variable is defined. This lets us relatively cleanly provide a default WARNS no matter where you're building in the src tree without breaking things outside of the tree. Crunchgen has been updated as a bootstrap tool to work on this change because it needs r365605 at a minimum to succeed. The cleanup necessary to successfully walk over this change on WITHOUT_CLEAN builds has been added. There is a supplemental project to this to list all of the warnings that are encountered when the environment has WARNS=6 NO_WERROR=yes: https://warns.kevans.dev -- this project will hopefully eventually go away in favor of CI doing a much better job than it. Reviewed by: emaste, brooks, ngie (all earlier version) Reviewed by: emaste, arichardson (depend-cleanup.sh change) Differential Revision: https://reviews.freebsd.org/D26455
59 lines
1.2 KiB
Makefile
59 lines
1.2 KiB
Makefile
# $FreeBSD$
|
|
|
|
.include <src.opts.mk>
|
|
|
|
GREP_LIBZ=YES
|
|
|
|
.if ${MK_BSD_GREP} != "yes"
|
|
PROG= grep
|
|
.else
|
|
PROG= gnugrep
|
|
.endif
|
|
SRCS= closeout.c dfa.c error.c exclude.c grep.c grepmat.c hard-locale.c \
|
|
isdir.c kwset.c obstack.c quotearg.c savedir.c search.c xmalloc.c \
|
|
xstrtoumax.c
|
|
CLEANFILES+= gnugrep.1
|
|
|
|
WARNS?= 0
|
|
|
|
CFLAGS+=-I${.CURDIR} -I${SYSROOT:U${DESTDIR}}/usr/include/gnu -DHAVE_CONFIG_H
|
|
|
|
.if ${MK_BSD_GREP} != "yes"
|
|
LINKS+= ${BINDIR}/grep ${BINDIR}/egrep \
|
|
${BINDIR}/grep ${BINDIR}/fgrep
|
|
MLINKS= grep.1 egrep.1 grep.1 fgrep.1
|
|
.endif
|
|
|
|
LIBADD= gnuregex bz2
|
|
|
|
.if defined(GREP_LIBZ) && !empty(GREP_LIBZ)
|
|
LIBADD+= z
|
|
CFLAGS+=-DHAVE_LIBZ=1
|
|
.endif
|
|
|
|
gnugrep.1: grep.1
|
|
${CP} ${.ALLSRC} ${.TARGET}
|
|
|
|
check: all
|
|
@failed=0; total=0; \
|
|
for tst in ${TESTS}; do \
|
|
total=$$(($$total+1)); \
|
|
if GREP=${.OBJDIR}/${PROG} srcdir=${.CURDIR}/tests \
|
|
${.CURDIR}/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 backref.sh file.sh
|
|
|
|
.include <bsd.prog.mk>
|