platform.mk: Support PREREQ_RUN_ADD

Modifying JW_PKG_XXX_PATH in pre-local.mk is fragile.

Amending PREREQ_RUN in pre-local.mk works, but only with $(JW_PKG_NO_CACHE) == true, or if "undefine JW_PKG_XXX_PATH" is also added in pre-local.mk. Otherwise JW_PKG_XXX_PATH will not be recomputed, because it's already defined from the cache.

Introduce the new variable PREREQ_RUN_ADD to solve that. If it's defined, it automatically invalidates the JW_PKG_XXX_PATH variables and sets them up for recalculation in py-path.mk / ldlibpath.mk.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-06-18 12:29:05 +02:00
commit 2cafd60b71
Signed by: Jan Lindemann
GPG key ID: 3750640C9E25DD61

View file

@ -18,6 +18,14 @@ $(eval $(call try_include,$(JWBDIR)/make/pre-local.mk))
$(eval $(call try_include,$(TOPDIR)/make/pre-local.mk))
$(eval $(call try_include,pre-local.mk))
ifdef PREREQ_RUN_ADD
# If PREREQ_RUN_ADD was defined in pre-local.mk, set these potentially cached
# paths up for fresh calculation in ldlibpath.mk / py-path.mk
undefine JW_PKG_EXE_PATH
undefine JW_PKG_LD_LIBRARY_PATH
undefine JW_PKG_PYTHON_PATH
PREREQ_RUN += $(PREREQ_RUN_ADD)
endif
# -- What do I know about myself?
VERSION_FILE ?= $(firstword $(wildcard VERSION) $(TOPDIR)/VERSION)