From bc2e85eb8df05e8e1e5a7542c243b33fcbbf6365 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Sat, 19 Sep 2026 11:32:20 +0200 Subject: [PATCH] build: clean the package root dir only if the packages can have changed The stamp of package/cleanup depends on tmp/.build, which is touched on every make call, so every build deletes $(STAGING_DIR_ROOT) and every package copies its files into it again, one after the other under a lock. With all packages selected, this takes 5 s of a build that has nothing to do, most of it in the 1102 kmods of package/kernel/linux. Only clean it if .config, the package metadata or a file below package/ changed since the last cleanup. An edit of the source in a build directory alone does not clean it, so a file that such an edit removes from a package stays until then. make package/cleanup cleans it at any time. Signed-off-by: John Crispin --- package/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/Makefile b/package/Makefile index e0b60891fec..6ff81fdd34d 100644 --- a/package/Makefile +++ b/package/Makefile @@ -188,7 +188,7 @@ endif $(curdir)/flags-install:= -j1 $(eval $(call stampfile,$(curdir),package,prereq,.config)) -$(eval $(call stampfile,$(curdir),package,cleanup,$(TMP_DIR)/.build)) +$(eval $(call stampfile,$(curdir),package,cleanup,.config $(TMP_DIR)/.packageinfo)) $(eval $(call stampfile,$(curdir),package,compile,$(TMP_DIR)/.build)) $(eval $(call stampfile,$(curdir),package,install,$(TMP_DIR)/.build)) $(eval $(call stampfile,$(curdir),package,check,$(TMP_DIR)/.build))