diff options
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/route/Makefile | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/sbin/route/Makefile b/sbin/route/Makefile index 0f4cd67..231c3da 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> |