From 5d552bcea80ec33d8c0872e22e2b5f59d720e8d6 Mon Sep 17 00:00:00 2001 From: James Hilliard Date: Sun, 17 May 2026 18:38:16 -0600 Subject: [PATCH] Makefile: avoid broad image wildcards in clean The clean target currently removes every *.bin, *.elf and *.sunxi file in the source directory. That can delete unrelated files placed in the tree, such as downloaded binaries or local test artifacts. Keep the existing executable, version.h and *.o cleanup, but replace the broad image wildcards with an explicit list of files generated by this Makefile. Also drop the stale *.nm and *.orig cleanup entries, since no build rule currently creates those files. Signed-off-by: James Hilliard --- Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 3d89718..5b7f76a 100644 --- a/Makefile +++ b/Makefile @@ -53,6 +53,10 @@ MISC_TOOLS = phoenix_info sunxi-nand-image-builder # ARM binaries and images # Note: To use this target, set/adjust CROSS_COMPILE and MKSUNXIBOOT if needed BINFILES = jtag-loop.sunxi fel-sdboot.sunxi uart0-helloworld-sdboot.sunxi +BINFILE_ELFS = $(BINFILES:.sunxi=.elf) +BINFILE_BINS = $(BINFILES:.sunxi=.bin) +BOOT_HEAD_ELFS = boot_head_sun3i.elf boot_head_sun4i.elf boot_head_sun5i.elf +CLEANFILES = $(BINFILES) $(BINFILE_ELFS) $(BINFILE_BINS) $(BOOT_HEAD_ELFS) MKSUNXIBOOT ?= mksunxiboot PATH_DIRS := $(shell echo $$PATH | sed -e 's/:/ /g') @@ -107,7 +111,7 @@ install-misc: $(MISC_TOOLS) clean: make -C tests/ clean @rm -vf $(TOOLS) $(FEXC_LINKS) $(TARGET_TOOLS) $(MISC_TOOLS) - @rm -vf version.h *.o *.elf *.sunxi *.bin *.nm *.orig + @rm -vf version.h *.o $(CLEANFILES) $(TOOLS) $(TARGET_TOOLS) $(MISC_TOOLS): Makefile common.h version.h