summaryrefslogtreecommitdiff
path: root/Makefile.inc
diff options
context:
space:
mode:
authorAnas Nashif <anas.nashif@intel.com>2015-08-02 10:05:07 -0400
committerAnas Nashif <anas.nashif@intel.com>2016-02-05 20:14:45 -0500
commit97493575a69de0be601cbf59bad4570d8b8f943c (patch)
tree3ce45dd8bc57dae668b3ce0c1a315973581abe5c /Makefile.inc
parentd07b3c7453bf63aeb314e3a6c44b88f930720f80 (diff)
build: simplify clean target
Do not delete files that do not exist and just clean the outdir directory which has all the objects. The source directories now do not have any built objects. Change-Id: I5774fa325717c65b6666de495b35f9b86f57473c Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Diffstat (limited to 'Makefile.inc')
-rw-r--r--Makefile.inc24
1 files changed, 5 insertions, 19 deletions
diff --git a/Makefile.inc b/Makefile.inc
index 777ae94ab..b9cd8b622 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -1,7 +1,7 @@
# vim: filetype=make
PROJECT_BASE ?= $(shell pwd)
-ARCH?=x86
+ARCH ?= x86
O ?= $(PROJECT_BASE)/outdir
# Turn O into an absolute path; we call the main Kbuild with $(MAKE) -C
@@ -60,28 +60,14 @@ all: $(CONFIG_DEPS) $(O)/.dir
PROJECT=$(PROJECT_BASE) SOURCE_DIR=$(SOURCE_DIR) \
CFLAGS=$(CFLAGS)
-rm-files:= .config
-rm-objects:= *.o
-rm-dirs := $(O)
-
-cmd_clean_inner_files = \
- $(shell cd $(PROJECT_BASE);rm $(rm-files) -f; rm $(rm-dirs) -rf)
-
-clean: FORCE
- $(Q)rm $(SOURCE_DIR)$(rm-objects) -f
- $(Q)rm $(SOURCE_DIR)/modules.order -f
- $(Q)rm $(SOURCE_DIR)/.*.cmd -f
- $(call cmd_clean_inner_files)
+clean: distclean
pristine: distclean
-distclean: clean
- @rm $(PROJECT_BASE)/.config -f
- @rm $(PROJECT_BASE)/.config.old -f
- @rm $(PROJECT_BASE)/.version -f
+distclean:
+ @rm -rf $(O)
-mrproper: FORCE
- $(call cmd_clean_inner_files)
+mrproper: clean FORCE
$(Q)$(MAKE) -C $(ZEPHYR_BASE) PROJECT=$(PROJECT_BASE) mrproper
%config: $(O)/.dir FORCE