summaryrefslogtreecommitdiffstats
path: root/usr.bin/getconf/Makefile
blob: 275b4f25d66ebf329039536325aaed4d6a9edb0e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#	$FreeBSD$

PROG=	getconf

SRCS=	confstr.c getconf.c limits.c pathconf.c progenv.c sysconf.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

.SUFFIXES: .gperf .names
.PHONY: conflicts

all:	conflicts

.gperf.c:
	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