mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@barebox.org>
To: barebox@lists.infradead.org
Cc: David Dgien <dgienda125@gmail.com>, Ahmad Fatoum <a.fatoum@barebox.org>
Subject: [PATCH 01/13] kbuild: fold rmdirs into rmfiles
Date: Fri, 16 Jan 2026 17:06:24 +0100	[thread overview]
Message-ID: <20260116160654.3981425-2-a.fatoum@barebox.org> (raw)
In-Reply-To: <20260116160654.3981425-1-a.fatoum@barebox.org>

Linux doesn't differentiate between the two either and by adopting that,
we can have intermediary .tmp_*/ directories automatically deleted when
cleaning.

Signed-off-by: Ahmad Fatoum <a.fatoum@barebox.org>
---
 Makefile | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/Makefile b/Makefile
index 3b31cecc22c4..e3127ed2cb37 100644
--- a/Makefile
+++ b/Makefile
@@ -1393,8 +1393,7 @@ MRPROPER_FILES += .config .config.old .security_config .version .old_version \
 
 # clean - Delete most, but leave enough to build external modules
 #
-clean: rm-dirs  := $(CLEAN_DIRS)
-clean: rm-files := $(CLEAN_FILES)
+clean: rm-files := $(CLEAN_FILES) $(CLEAN_DIRS)
 clean-dirs      := $(addprefix _clean_,$(srctree) $(barebox-alldirs))
 
 PHONY += $(clean-dirs) clean archclean
@@ -1403,7 +1402,6 @@ $(clean-dirs):
 	$(Q)$(MAKE) $(clean)=$(patsubst _clean_%,%,$@)
 
 clean: archclean $(clean-dirs)
-	$(call cmd,rmdirs)
 	$(call cmd,rmfiles)
 	@find . $(RCS_FIND_IGNORE) \
 		\( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \
@@ -1416,8 +1414,7 @@ clean: archclean $(clean-dirs)
 
 # mrproper - Delete all generated files, including .config
 #
-mrproper: rm-dirs  := $(wildcard $(MRPROPER_DIRS))
-mrproper: rm-files := $(wildcard $(MRPROPER_FILES))
+mrproper: rm-files := $(wildcard $(MRPROPER_DIRS)) $(wildcard $(MRPROPER_FILES))
 mrproper-dirs      := $(addprefix _mrproper_,scripts)
 
 PHONY += $(mrproper-dirs) mrproper
@@ -1425,7 +1422,6 @@ $(mrproper-dirs):
 	$(Q)$(MAKE) $(clean)=$(patsubst _mrproper_%,%,$@)
 
 mrproper: clean $(mrproper-dirs)
-	$(call cmd,rmdirs)
 	$(call cmd,rmfiles)
 
 # distclean
@@ -1590,11 +1586,8 @@ target-dir = $(dir $@)
 # FIXME Should go into a make.lib or something
 # ===========================================================================
 
-quiet_cmd_rmdirs = $(if $(wildcard $(rm-dirs)),CLEAN   $(wildcard $(rm-dirs)))
-      cmd_rmdirs = rm -rf $(rm-dirs)
-
 quiet_cmd_rmfiles = $(if $(wildcard $(rm-files)),CLEAN   $(wildcard $(rm-files)))
-      cmd_rmfiles = rm -f $(rm-files)
+      cmd_rmfiles = rm -rf $(rm-files)
 
 
 a_flags = -Wp,-MD,$(depfile) $(KBUILD_AFLAGS) $(AFLAGS_KERNEL) \
-- 
2.47.3




  reply	other threads:[~2026-01-16 16:07 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-16 16:06 [PATCH 00/13] ARM32: modules: fix bitrot and add test Ahmad Fatoum
2026-01-16 16:06 ` Ahmad Fatoum [this message]
2026-01-16 16:06 ` [PATCH 02/13] boards: qemu-virt: reserve BIOS device tree Ahmad Fatoum
2026-01-16 16:06 ` [PATCH 03/13] ARM: qemu-virt: add image for use as -bios Ahmad Fatoum
2026-01-16 16:06 ` [PATCH 04/13] kbuild: build *.mod.c with -std=gnu11 Ahmad Fatoum
2026-01-16 16:06 ` [PATCH 05/13] ARM32: mark modules as incompatible with ARM_MMU_PERMISSIONS Ahmad Fatoum
2026-01-16 16:06 ` [PATCH 06/13] treewide: fix some missing EXPORT_SYMBOL Ahmad Fatoum
2026-01-16 16:06 ` [PATCH 07/13] pci: ecam: enable build as module Ahmad Fatoum
2026-01-16 16:06 ` [PATCH 08/13] kbuild: add support for installing and stripping modules Ahmad Fatoum
2026-01-16 16:06 ` [PATCH 09/13] ARM32: module: handle more relocations Ahmad Fatoum
2026-01-16 16:06 ` [PATCH 10/13] commands: pm_domain: make command tristate Ahmad Fatoum
2026-01-16 16:06 ` [PATCH 11/13] test: conftest: add support for describing FW_CFG environment in YAML Ahmad Fatoum
2026-01-16 16:06 ` [PATCH 12/13] defaultenv: add barebox_modules_env target Ahmad Fatoum
2026-01-16 16:06 ` [PATCH 13/13] test: arm: add simple driver/command module test Ahmad Fatoum
2026-01-19  7:28 ` [PATCH 00/13] ARM32: modules: fix bitrot and add test Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260116160654.3981425-2-a.fatoum@barebox.org \
    --to=a.fatoum@barebox.org \
    --cc=barebox@lists.infradead.org \
    --cc=dgienda125@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox