Separate dependencies on tools built for host.

When generated files depend on tools that need to be built for host,
we need to carefully separate them for the DIRDEPS_BUILD so we
only build them once.

Reviewed by:	stevek
Sponsored by:	Juniper Networks, Inc.
This commit is contained in:
Simon J. Gerraty 2023-06-29 23:52:03 -07:00
parent af2939f227
commit fcc8d72702
2 changed files with 8 additions and 4 deletions

View file

@ -44,22 +44,25 @@ build-tools: mknodes mksyntax
DEPENDOBJS+= mknodes mksyntax
mknodes mksyntax: ${BUILD_TOOLS_META}
builtins.c builtins.h: mkbuiltins
syntax.c syntax.h: mksyntax
nodes.c nodes.h: mknodes
.endif
.ORDER: builtins.c builtins.h
builtins.h: .NOMETA
builtins.c builtins.h: mkbuiltins builtins.def
builtins.c builtins.h: builtins.def
sh ${.CURDIR}/mkbuiltins ${.CURDIR}
.ORDER: nodes.c nodes.h
nodes.h: .NOMETA
nodes.c nodes.h: mknodes nodetypes nodes.c.pat
nodes.c nodes.h: nodetypes nodes.c.pat
${BTOOLSPATH:U.}/mknodes ${.CURDIR}/nodetypes ${.CURDIR}/nodes.c.pat
.ORDER: syntax.c syntax.h
syntax.h: .NOMETA
syntax.c syntax.h: mksyntax
syntax.c syntax.h:
${BTOOLSPATH:U.}/mksyntax
token.h: mktokens

View file

@ -22,12 +22,13 @@ CLEANFILES= maketab proctab.c awkgram.tab.h
awkgram.tab.h: awkgram.h
ln -sf ${.ALLSRC:M*.h} ${.TARGET}
proctab.c: maketab awkgram.tab.h
proctab.c: awkgram.tab.h
${BTOOLSPATH:U.}/maketab awkgram.tab.h > proctab.c
.if ${MACHINE} == "host" || ${MK_DIRDEPS_BUILD} == "no"
DEPENDOBJS+= maketab
build-tools: maketab
proctab.c: maketab
maketab: awkgram.tab.h ${BUILD_TOOLS_META}
.endif