aboutsummaryrefslogtreecommitdiff
path: root/sbin/route/Makefile
diff options
context:
space:
mode:
authorHiroki Sato <hrs@FreeBSD.org>2013-07-17 13:47:13 +0000
committerHiroki Sato <hrs@FreeBSD.org>2013-07-17 13:47:13 +0000
commit0365230a1a358fffd696ec11e8fc9d205c7de615 (patch)
treef88760f0ee5b35192325b9800a36acc7a11ccb95 /sbin/route/Makefile
parentd356583dbcf963a0dbf1eac1f8bd67f4dcc47e14 (diff)
downloadsrc-0365230a1a358fffd696ec11e8fc9d205c7de615.tar.gz
src-0365230a1a358fffd696ec11e8fc9d205c7de615.zip
Simplify keywords.h generation.
Notes
Notes: svn path=/head/; revision=253424
Diffstat (limited to 'sbin/route/Makefile')
-rw-r--r--sbin/route/Makefile14
1 files changed, 5 insertions, 9 deletions
diff --git a/sbin/route/Makefile b/sbin/route/Makefile
index 0f4cd67e41ed..231c3dad8b3f 100644
--- a/sbin/route/Makefile
+++ b/sbin/route/Makefile
@@ -7,7 +7,7 @@ PROG= route
MAN= route.8
SRCS= route.c keywords.h
WARNS?= 3
-CLEANFILES+=keywords.h _keywords.tmp
+CLEANFILES+=keywords.h
CFLAGS+= -DNS
@@ -18,13 +18,9 @@ CFLAGS+= -DINET6
CFLAGS+= -I.
keywords.h: keywords
- sed -e '/^#/d' -e '/^$$/d' ${.CURDIR}/keywords > _keywords.tmp
- LC_ALL=C tr 'a-z' 'A-Z' < _keywords.tmp | paste _keywords.tmp - | \
- awk '{ \
- if (NF > 1) \
- printf "#define\tK_%s\t%d\n\t{\"%s\", K_%s},\n", \
- $$2, NR, $$1, $$2 }' \
- > ${.TARGET}
- rm -f _keywords.tmp
+ LC_ALL=C awk '!/^#|^$$/ { \
+ printf "#define\tK_%s\t%d\n\t{\"%s\", K_%s},\n", \
+ toupper($$1), ++L, $$1, toupper($$1); \
+ }' < ${.CURDIR}/keywords > ${.TARGET} || (rm -f ${.TARGET}; false)
.include <bsd.prog.mk>