freebsd-dev/usr.bin/getconf/Makefile
Garrett Wollman 0840e619bb Move unsigned limits to a separate table/recognizer and display them
using the appropriate (unsigned) format specification.  This prevents
integer overflow when ULLONG_MAX and (on some architectures) ULONG_MAX
are used to initialize an intmax_t and then displayed as the signed
value -1.  (A different approach was suggested in the bug report,
which I did not use.)  If other limits are defined to be unsigned,
they could be moved here.

PR:		164049
Reported by:	Marcus Reid
2018-05-23 02:51:56 +00:00

45 lines
1.1 KiB
Makefile

# $FreeBSD$
.include <src.opts.mk>
PROG= getconf
SRCS= confstr.c getconf.c limits.c pathconf.c progenv.c sysconf.c \
unsigned_limits.c
CFLAGS+= -I${.CURDIR}
CLEANFILES+= confstr.c limits.c pathconf.c progenv.c sysconf.c \
confstr.names limits.names pathconf.names sysconf.names \
conflicting.names unique.names unsigned_limits.names
.SUFFIXES: .gperf .names
.PHONY: conflicts
all: conflicts
FAKE_GPERF= ${.CURDIR}/fake-gperf.awk
.gperf.c: ${FAKE_GPERF}
LC_ALL=C awk -f ${FAKE_GPERF} ${.IMPSRC} >${.TARGET}
.gperf.names:
LC_ALL=C awk '/^[_A-Z]/ { print; }' ${.IMPSRC} | \
sed -e 's/,$$//' >${.TARGET}
conflicts: conflicting.names unique.names
@if test `wc -l <conflicting.names` != `wc -l <unique.names`; then \
echo "Name conflicts found!" >&2; \
exit 1; \
fi
# pathconf.names is not included here because pathconf names are
# syntactically distinct from the other kinds.
conflicting.names: confstr.names limits.names sysconf.names
cat ${.ALLSRC} >${.TARGET}
unique.names: conflicting.names
LC_ALL=C sort -u ${.ALLSRC} >${.TARGET}
HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests
.include <bsd.prog.mk>