summaryrefslogtreecommitdiffstats
path: root/usr.bin/getconf/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/getconf/Makefile')
-rw-r--r--usr.bin/getconf/Makefile30
1 files changed, 26 insertions, 4 deletions
diff --git a/usr.bin/getconf/Makefile b/usr.bin/getconf/Makefile
index 23122b3..275b4f2 100644
--- a/usr.bin/getconf/Makefile
+++ b/usr.bin/getconf/Makefile
@@ -2,13 +2,35 @@
PROG= getconf
-SRCS= confstr.c getconf.c pathconf.c sysconf.c
+SRCS= confstr.c getconf.c limits.c pathconf.c progenv.c sysconf.c
CFLAGS+= -I${.CURDIR}
-CLEANFILES+= confstr.c pathconf.c sysconf.c
+CLEANFILES+= confstr.c limits.c pathconf.c progenv.c sysconf.c \
+ confstr.names limits.names pathconf.names sysconf.names \
+ conflicting.names unique.names
-.SUFFIXES: .gperf
+.SUFFIXES: .gperf .names
+.PHONY: conflicts
+
+all: conflicts
.gperf.c:
- gperf -t -L ANSI-C -C -k 1,2,7-10,21,'$$' ${.IMPSRC} >${.TARGET}
+ awk -f ${.CURDIR}/fake-gperf.awk ${.IMPSRC} >${.TARGET}
+
+.gperf.names:
+ 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
+ sort -u ${.ALLSRC} >${.TARGET}
.include <bsd.prog.mk>
OpenPOWER on IntegriCloud