aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Evans <kevans@FreeBSD.org>2025-10-06 17:50:22 +0000
committerKyle Evans <kevans@FreeBSD.org>2025-10-06 17:51:29 +0000
commitab492c08fc3cbf4fb5d569663c0751bc2a41cb1f (patch)
tree8e2558999e485db48ed58981edc791ed951189de
parentf19ef352ec63f9fcc10076a263b8ce402ba31379 (diff)
build: don't create duplicate bootstrap-tools targets
The general problem is that we might have a somewhat complicated dependency tree depending on bootstrap version requirements. We could document when multiple bootstrap tools might have a shared dependency and be careful to add them only once to the list, but that is a little more fragile- particularly if we purge some bootstrap tools and need to re-work the logic a little bit. Just avoid redefining the build commands as we're iterating over the list so that we can keep the actual requirements intact. PR: 289997 Reported by: dhw, others Reviewed by: imp Fixes: 151bd3516b5 ("flua: support our flua modules in [...]") Differential Revision: https://reviews.freebsd.org/D52904
-rw-r--r--Makefile.inc111
1 files changed, 10 insertions, 1 deletions
diff --git a/Makefile.inc1 b/Makefile.inc1
index 6ace6a6b5eaf..9dc4f2db4a6c 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -2842,6 +2842,15 @@ bootstrap-tools: ${_bt}-links .PHONY
${_mkesdb} \
${_zic} \
${LOCAL_BSTOOL_DIRS}
+# We don't enforce any particular uniqueness of targets in the above list; it
+# may be the case that different bootstrap tools may have shared dependencies
+# at different BOOTSTRAPPING points, so we don't object to them using their own
+# conditionals and duplicating them into their ${_foo} variable to ease future
+# maintenance if we purge some entries. These target names are purposefully
+# unique and this is the only place that should be generating commands for them,
+# but the target may have been defined earlier to express dependencies -- thus,
+# we specifically want commands() here.
+.if !commands(${_bt}-${_tool})
${_bt}-${_tool}: ${_bt}-links .PHONY .MAKE
${_+_}@${ECHODIR} "===> ${_tool} (obj,all,install)"; \
cd ${.CURDIR}/${_tool}; \
@@ -2851,8 +2860,8 @@ ${_bt}-${_tool}: ${_bt}-links .PHONY .MAKE
fi; \
${MAKE} DIRPRFX=${_tool}/ all; \
${MAKE} DIRPRFX=${_tool}/ DESTDIR=${WORLDTMP}/legacy install
-
bootstrap-tools: ${_bt}-${_tool}
+.endif
.endfor
.if target(${_bt}-lib/libmd)
# If we are bootstrapping libmd (e.g. when building on macOS/Linux) add the