From 2bd1e5b2dde37f38eba010334ff087b253d3a62f Mon Sep 17 00:00:00 2001 From: Juan Manuel Cruz Date: Sat, 9 May 2015 18:11:51 -0500 Subject: [PATCH] Kbuild: Fix for the clean target. This commit fixes the clean target. The issue is that clean target was not cleaning the file inside the source tree. Change-Id: I12b41e28591121a167734428132c4bd9021bccd9 Signed-off-by: Juan Manuel Cruz Signed-off-by: Anas Nashif --- Makefile.inc | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Makefile.inc b/Makefile.inc index e16737603e9..330fad8ef61 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -31,14 +31,19 @@ all: $(CONFIG_DEPS) rm-files:= final-linker.cmd linker.cmd modules.order \ staticIdt.o System.map *kernel.lnk \ *kernel.map *kernel.elf +rm-objects:= *.o rm-dirs := arch drivers include kernel lib misc \ scripts source -clean: FORCE - $(shell cd $(PROJECT_BASE);rm $(rm-files) -f) - $(shell cd $(PROJECT_BASE);rm $(rm-dirs) -r) +cmd_clean_inner_files = \ + $(shell cd $(PROJECT_BASE);rm $(rm-files) -f; rm $(rm-dirs) -rf) -mrproper: clean +clean: FORCE + @rm $(SOURCE_DIR)$(rm-objects) -f + $(call cmd_clean_inner_files) + +mrproper: FORCE + $(call cmd_clean_inner_files) $(Q)$(MAKE) -C $(TIMO_BASE) \ PROJECT=$(PROJECT_BASE) mrproper @@ -66,7 +71,7 @@ initconfig: PROJECT=$(PROJECT_BASE) oldconfig -PHONY += FORCE +PHONY += FORCE clean mrproper FORCE: .PHONY: $(PHONY)