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@xxxxxxx> --- arm/Makefile.common | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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) -- 2.25.1