From 39ed48c8f12eec91d5bf39d37ca666b6a937cc87 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Sat, 19 Sep 2026 09:11:44 +0200 Subject: [PATCH] build: clean all stamps of a subdir stampfile assigns the clean rule of its stamp to //clean with :=, so every call replaces the one before. toolchain and tools define a compile and a check stamp, and /clean only removes the check stamp. After "make toolchain/clean", the compile stamp is newer than the toolchain sources, the next build takes the toolchain as built, and the target build fails because the compiler is missing. Append the clean rule instead, so that all stamps are removed. Signed-off-by: John Crispin --- include/subdir.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/subdir.mk b/include/subdir.mk index b4edbf8b96c..6908b083758 100644 --- a/include/subdir.mk +++ b/include/subdir.mk @@ -101,7 +101,7 @@ define stampfile .PRECIOUS: $$($(1)/stamp-$(3)) # work around a make bug - $(1)//clean:=$(1)/stamp-$(3)/clean + $(1)//clean+=$(1)/stamp-$(3)/clean $(1)/stamp-$(3)/clean: FORCE @rm -f $$($(1)/stamp-$(3))