freebsd-dev/usr.bin/awk/Makefile
Bryan Drewery 384850e063 WITH_META_MODE: Fix rebuilding maketab outside of build-tools.
The bsd.dep.mk yacc targets rely on only the .c file getting a .meta
file.  However the previous code here relying on only the .h file meant
that it would be generated with a .meta file.  r301285 made it so that
the .h file is never expected to get a .meta file.  To keep this
restriction in place add in an extra dependency on the .c file so that
it is generated at this time.  It's a hack but the best for the patterns
we have at the moment for handling build-tools and side-effect-generated
files.

Reported by:	Mark Millard
Approved by:	re (implicit)
Sponsored by:	EMC / Isilon Storage Division
2016-06-14 16:20:05 +00:00

32 lines
667 B
Makefile

# $FreeBSD$
AWKSRC= ${.CURDIR}/../../contrib/one-true-awk
.PATH: ${AWKSRC}
PROG= awk
SRCS= awkgram.y b.c lex.c lib.c main.c parse.c proctab.c run.c tran.c ytab.h
CFLAGS+= -DHAS_ISBLANK -I. -I${AWKSRC} -DFOPEN_MAX=64
WARNS?= 1
LIBADD= m
LINKS= ${BINDIR}/awk ${BINDIR}/nawk
MLINKS= awk.1 nawk.1
CLEANFILES= maketab proctab.c ytab.h
# XXX: awkgram.c isn't really needed here but it is added to keep
# awkgram.h: .NOMETA respected.
ytab.h: awkgram.c awkgram.h .NOMETA
ln -sf ${.ALLSRC:M*.h} ${.TARGET}
proctab.c: maketab
${BTOOLSPATH:U.}/maketab > proctab.c
build-tools: maketab
maketab: ytab.h ${AWKSRC}/maketab.c ${BUILD_TOOLS_META}
.include <bsd.prog.mk>