xref: /dragonfly/usr.bin/getconf/Makefile (revision b4f25088)
1# $FreeBSD: src/usr.bin/getconf/Makefile,v 1.3.2.2 2002/11/25 09:02:40 ru Exp $
2# $DragonFly: src/usr.bin/getconf/Makefile,v 1.3 2007/08/27 16:50:54 pavalos Exp $
3
4PROG=	getconf
5
6SRCS=	confstr.c getconf.c limits.c pathconf.c progenv.c sysconf.c
7CFLAGS+= -I${.CURDIR} -DSTABLE
8CLEANFILES+=	confstr.c limits.c pathconf.c progenv.c sysconf.c \
9		confstr.names limits.names pathconf.names sysconf.names \
10		conflicting.names unique.names
11WARNS?=	2
12
13.SUFFIXES: .gperf .names
14.PHONY: conflicts
15
16all:	conflicts
17
18.gperf.c:
19	LC_ALL=C awk -f ${.CURDIR}/fake-gperf.awk ${.IMPSRC} >${.TARGET}
20
21.gperf.names:
22	LC_ALL=C awk '/^[_A-Z]/ { print; }' ${.IMPSRC} | \
23	    sed -e 's/,$$//' >${.TARGET}
24
25conflicts: conflicting.names unique.names
26	@if test `wc -l <conflicting.names` != `wc -l <unique.names`; then \
27		echo "Name conflicts found!" >&2; \
28		/usr/bin/false; \
29	fi
30
31# pathconf.names is not included here because pathconf names are
32# syntactically distinct from the other kinds.
33conflicting.names:	confstr.names limits.names sysconf.names
34	cat ${.ALLSRC} >${.TARGET}
35
36unique.names:		conflicting.names
37	LC_ALL=C sort -u ${.ALLSRC} >${.TARGET}
38
39.include <bsd.prog.mk>
40