From 6325f9ea19baf75f4299d05ec663ab8966e11c03 Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Wed, 8 Jul 2026 19:34:41 +0200 Subject: [PATCH] platform.mk: Fix make -C $(TOPDIR)/make clean all If run from $(TOPDIR), "make clean all" runs fine, because it recurses twice into $(TOPDIR)/make, once for every target. If invoked directly from $(TOPDIR)/make, it can break in two different ways: If the cache files don't exist, "make clean all" in $(TOPDIR)/make tries to create them too early as implicit make target. This leaves variables empty which should have a value. If the cache files do exist, "make clean all" in $(TOPDIR)/make includes them, cleans them, and re-creates them from the same variables just read from cache. Undesirable for cache purging. Signed-off-by: Jan Lindemann --- make/platform.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/make/platform.mk b/make/platform.mk index 117b4dc0..2caad545 100644 --- a/make/platform.mk +++ b/make/platform.mk @@ -12,8 +12,10 @@ endef CACHE_PROJECTS_MK := $(JWBDIR)/cache-projects.mk +ifeq ($(filter clean distclean,$(MAKECMDGOALS)),) $(eval $(call try_include,$(TOPDIR)/make/.cache-project.mk)) $(eval $(call try_include,$(CACHE_PROJECTS_MK))) +endif $(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))