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 <james.hilliard1@gmail.com>
This commit is contained in:
James Hilliard 2026-05-17 18:38:16 -06:00 committed by Andre Przywara
parent 7540cb2356
commit 5d552bcea8

View File

@ -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