From 3a3e8f74fe6ef8247c5b6c4053b3ac198df1be1e Mon Sep 17 00:00:00 2001 From: crasbe Date: Mon, 14 Apr 2025 16:45:27 +0200 Subject: [PATCH] buildsystem: clean dist/tools with (dist)clean as well --- Makefile | 4 ++-- makefiles/app_dirs.inc.mk | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index dbfbfb4163..fab024115a 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ docclean: clean: @echo "Cleaning all build products for the current board" - @for dir in $(APPLICATION_DIRS); do "$(MAKE)" -C$$dir clean; done + @for dir in $(APPLICATION_DIRS) $(TOOLS_DIRS); do "$(MAKE)" -C$$dir clean; done pkg-clean: @echo "Cleaning all package sources" @@ -25,7 +25,7 @@ pkg-clean: distclean: docclean pkg-clean @echo "Cleaning all build products" - @for dir in $(APPLICATION_DIRS); do "$(MAKE)" -C$$dir distclean; done + @for dir in $(APPLICATION_DIRS) $(TOOLS_DIRS); do "$(MAKE)" -C$$dir distclean; done print-versions: @./dist/tools/ci/print_toolchain_versions.sh diff --git a/makefiles/app_dirs.inc.mk b/makefiles/app_dirs.inc.mk index 878bd2a85b..0b8d302583 100644 --- a/makefiles/app_dirs.inc.mk +++ b/makefiles/app_dirs.inc.mk @@ -4,6 +4,7 @@ RIOTBASE ?= . APPS_BASE_DIRS = bootloaders examples fuzzing tests +TOOLS_BASE_DIRS = dist/tools # 1. recursively find Makefiles # 2. take parent folders @@ -16,6 +17,12 @@ APPLICATION_DIRS := $(shell find $(APPS_BASE_DIRS) -name Makefile -type f | \ grep -vFf $(RIOTBASE)/makefiles/app_dirs.blacklist | \ sort | uniq) +# used for `make claen` and `make distclean` +TOOLS_DIRS := $(shell find $(TOOLS_BASE_DIRS) -mindepth 2 -maxdepth 2 -name Makefile -type f | \ + xargs dirname | \ + grep -vFf $(RIOTBASE)/makefiles/app_dirs.blacklist | \ + sort | uniq) + info-applications: @for dir in $(APPLICATION_DIRS); do echo $$dir; done