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