diff mbox series

[U-Boot,2/3] Makefile: consolidate hardcoded lists of files to clean

Message ID 7bfdfb57c37331e234038e8429446c50d617c5cb.1573403105.git.tommyhebb@gmail.com
State Accepted
Commit 0f18cf32fbc23590515886f1c430cf72034544f9
Delegated to: Tom Rini
Headers show
Series None | expand

Commit Message

Tom Hebb Nov. 10, 2019, 4:25 p.m. UTC
Currently, we have two places where we list files that should always be
cleaned if they exist. One, the CLEAN_FILES variable, is from the Linux
build system and is the proper place to list files.

The other, a set of extra arguments passed in the xargs template used to
remove files with certain extensions, was introduced by 8f06f0cee3d3
("Makefile: clean image.map") and is clearly wrong: by extending the
xargs template, we attempt to remove the files once for each batch of
arguments that xargs produces and we reduce the number of files from
stdin that xargs can include in each of its rm commands.

To fix this, put all hardcoded files into CLEAN_FILES.

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>
---
 Makefile | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Tom Rini Dec. 4, 2019, 4:01 a.m. UTC | #1
On Sun, Nov 10, 2019 at 08:25:09AM -0800, Thomas Hebb wrote:

> Currently, we have two places where we list files that should always be
> cleaned if they exist. One, the CLEAN_FILES variable, is from the Linux
> build system and is the proper place to list files.
> 
> The other, a set of extra arguments passed in the xargs template used to
> remove files with certain extensions, was introduced by 8f06f0cee3d3
> ("Makefile: clean image.map") and is clearly wrong: by extending the
> xargs template, we attempt to remove the files once for each batch of
> arguments that xargs produces and we reduce the number of files from
> stdin that xargs can include in each of its rm commands.
> 
> To fix this, put all hardcoded files into CLEAN_FILES.
> 
> Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index 1186a1d34c..4ac722cd44 100644
--- a/Makefile
+++ b/Makefile
@@ -1900,7 +1900,7 @@  CLEAN_DIRS  += $(MODVERDIR) \
 CLEAN_FILES += include/bmp_logo.h include/bmp_logo_data.h tools/version.h \
 	       boot* u-boot* MLO* SPL System.map fit-dtb.blob* \
 	       u-boot-ivt.img.log u-boot-dtb.imx.log SPL.log u-boot.imx.log \
-	       lpc32xx-*
+	       lpc32xx-* bl31.c bl31.elf bl31_*.bin image.map tispl.bin*
 
 # Directories & files removed with 'make mrproper'
 MRPROPER_DIRS  += include/config include/generated spl tpl \
@@ -1934,8 +1934,7 @@  clean: $(clean-dirs)
 		-o -name modules.builtin -o -name '.tmp_*.o.*' \
 		-o -name 'dsdt.aml' -o -name 'dsdt.asl.tmp' -o -name 'dsdt.c' \
 		-o -name '*.efi' -o -name '*.gcno' -o -name '*.so' \) \
-		-type f -print | xargs rm -f \
-		bl31.c bl31.elf bl31_*.bin image.map tispl.bin*
+		-type f -print | xargs rm -f
 
 # mrproper - Delete all generated files, including .config
 #