xref: /dragonfly/usr.bin/getconf/Makefile (revision 2cd2d2b5)
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.2 2003/06/17 04:29:27 dillon 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
11
12.SUFFIXES: .gperf .names
13.PHONY: conflicts
14
15all:	conflicts
16
17.gperf.c:
18	LC_ALL=C awk -f ${.CURDIR}/fake-gperf.awk ${.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