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