diff mbox series

[kvm-unit-tests,1/3] arm/arm64: Avoid wildcard in the arm_clean recipe of the Makefile

Message ID 20210324171402.371744-2-nikos.nikoleris@arm.com (mailing list archive)
State New, archived
Headers show
Series Add support for external tests and litmus7 documentation | expand

Commit Message

Nikos Nikoleris March 24, 2021, 5:14 p.m. UTC
This change adds recipes to discover the generated .o and .d files and
removes assumptions about their locations in the arm_clean recipe.

Signed-off-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
---
 arm/Makefile.common | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/arm/Makefile.common b/arm/Makefile.common
index a123e85..19db50d 100644
--- a/arm/Makefile.common
+++ b/arm/Makefile.common
@@ -78,9 +78,12 @@  FLATLIBS = $(libcflat) $(LIBFDT_archive) $(libgcc) $(libeabi)
 $(libeabi): $(eabiobjs)
 	$(AR) rcs $@ $^
 
+generated-o = $(cflatobjs) $(eabiobjs) $(cstart.o) $(tests-all:.flat=.o)
+generated-d = $(join $(dir $(generated-o)), $(addprefix ., $(notdir $(generated-o:.o=.d))))
+
 arm_clean: libfdt_clean asm_offsets_clean
-	$(RM) $(TEST_DIR)/*.{o,flat,elf} $(libeabi) $(eabiobjs) \
-	      $(TEST_DIR)/.*.d lib/arm/.*.d
+	$(RM) $(generated-d)
+	$(RM) $(generated-o) $(tests-all:.flat=.elf) $(tests-all) $(libeabi)
 
 generated-files = $(asm-offsets)
 $(tests-all:.flat=.o) $(cstart.o) $(cflatobjs): $(generated-files)