awk: Fix dependencies

proctab.c is generated from awktab.h, so needs to depend on it.
maketab does not depend on awktab.h, and gets the maketab.c dependency
automatically, so remove them both.

Normally, these don't matter. However, for a meta build, they can cause
us to build maketab twice (once host, once for target) resulting in a
binary that can't run on the host due to proctab.c racing maketab in
parallel legs. In stable/12, this was a reliably lost race, while in
main I've been unable to trigger the race at all (maybe due to dirdep
changes making main more robust).

MFC After:	1 day (build breakage)
Reported by:	kp
Sponsored by:	Netflix
This commit is contained in:
Warner Losh 2021-07-31 15:41:29 -06:00
parent ff01d6343f
commit c50c8502cb

View File

@ -22,12 +22,12 @@ CLEANFILES= maketab proctab.c awkgram.tab.h
awkgram.tab.h: awkgram.h
ln -sf ${.ALLSRC:M*.h} ${.TARGET}
proctab.c: maketab
proctab.c: maketab awkgram.h
${BTOOLSPATH:U.}/maketab awkgram.h > proctab.c
DEPENDOBJS+= maketab
build-tools: maketab
maketab: awkgram.tab.h maketab.c ${BUILD_TOOLS_META}
maketab: ${BUILD_TOOLS_META}
# awk needs some work before we can connect these tests to the build
#HAS_TESTS=