Makefile revision 319382
1# $FreeBSD: stable/10/usr.bin/getconf/Makefile 319382 2017-06-01 06:39:55Z ngie $
2
3PROG=	getconf
4
5SRCS=	confstr.c getconf.c limits.c pathconf.c progenv.c sysconf.c
6CFLAGS+= -I${.CURDIR}
7CLEANFILES+=	confstr.c limits.c pathconf.c progenv.c sysconf.c \
8		confstr.names limits.names pathconf.names sysconf.names \
9		conflicting.names unique.names
10
11.SUFFIXES: .gperf .names
12.PHONY: conflicts
13
14all:	conflicts
15
16FAKE_GPERF=	${.CURDIR}/fake-gperf.awk
17.gperf.c: ${FAKE_GPERF}
18	LC_ALL=C awk -f ${FAKE_GPERF} ${.IMPSRC} >${.TARGET}
19
20.gperf.names:
21	LC_ALL=C awk '/^[_A-Z]/ { print; }' ${.IMPSRC} | \
22	    sed -e 's/,$$//' >${.TARGET}
23
24conflicts: conflicting.names unique.names
25	@if test `wc -l <conflicting.names` != `wc -l <unique.names`; then \
26		echo "Name conflicts found!" >&2; \
27		exit 1; \
28	fi
29
30# pathconf.names is not included here because pathconf names are
31# syntactically distinct from the other kinds.
32conflicting.names:	confstr.names limits.names sysconf.names
33	cat ${.ALLSRC} >${.TARGET}
34
35unique.names:		conflicting.names
36	LC_ALL=C sort -u ${.ALLSRC} >${.TARGET}
37
38.include <bsd.prog.mk>
39