summaryrefslogtreecommitdiff
path: root/Makefile.inc
diff options
context:
space:
mode:
authorAnas Nashif <anas.nashif@intel.com>2015-08-28 14:22:29 -0400
committerAnas Nashif <anas.nashif@intel.com>2016-02-05 20:15:33 -0500
commite80edfc7bfac342a94fabfe9969149d85f6a8305 (patch)
tree9c32f3f6949ef6ca1355afb676d2114156692b9d /Makefile.inc
parentcec625afc46c6444af39293b4a5bd41effca1448 (diff)
cleanup Makefile.inc and fixed mergeconfig
Remove the environment file due the fact it was destructive and removed existing .config and build environment. Now, if you change the architecture, you will not be building against old environment, instead, kconfig will prompt you for the changes. Change-Id: Ib557dd2a0562dcfe23fee60863b3e667f1c99060 Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Diffstat (limited to 'Makefile.inc')
-rw-r--r--Makefile.inc39
1 files changed, 8 insertions, 31 deletions
diff --git a/Makefile.inc b/Makefile.inc
index defef0150..875b1a75e 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -27,12 +27,6 @@ endif
export KBUILD_DEFCONFIG
endif
-ifdef KBUILD_DEFCONFIG
-CONFIG_DEPS=$(O)/.initconfig
-else
-CONFIG_DEPS=FORCE
-endif
-
SOURCE_DIR ?= $(PROJECT_BASE)/src/
# Kbuild doesn't work correctly if this is an absolute path
# FIXME Do not depend on python
@@ -56,8 +50,6 @@ else
S = -s
endif
-BEENTHERE = $(O)/.$(ARCH)-$(PLATFORM_CONFIG)-$(KERNEL_TYPE).env
-
CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
else if [ -x /bin/bash ]; then echo /bin/bash; \
else echo sh; fi ; fi)
@@ -65,33 +57,18 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
zephyrmake = @$(MAKE) -C $(ZEPHYR_BASE) O=$(1) CFLAGS="$(CFLAGS)" \
PROJECT=$(PROJECT_BASE) SOURCE_DIR=$(SOURCE_DIR) $(2)
-all: $(CONFIG_DEPS) $(O)/.dir
+all: $(O)/.dir $(O)/.config
$(Q)$(call zephyrmake,$(O),$@)
-qemu: $(CONFIG_DEPS) $(O)/.dir
+qemu: $(O)/.dir $(O)/.config
$(Q)$(call zephyrmake,$(O),$@)
-# FIXME: Use defconfig to create directory and copy file
-$(O)/.config: $(O)/.dir $(BEENTHERE)
- $(Q)cp $(KBUILD_DEFCONFIG_PATH) $(O)/.config
-
-$(O)/.initconfig: mergeconfig
+$(O)/.config: $(CONF_FILE)
+ $(Q)$(CONFIG_SHELL) $(ZEPHYR_BASE)/scripts/kconfig/merge_config.sh \
+ -q -m -O $(O) $(KBUILD_DEFCONFIG_PATH) $<
$(Q)yes "" | $(MAKE) $(S) -C $(ZEPHYR_BASE) O=$(O) \
PROJECT=$(PROJECT_BASE) oldconfig
- $(Q)touch $@
-
-
-# FIXME: Use provided mergeconfig target in kconfig/Makefile
-#
-ifneq ($(strip $(CONF_FILE)),)
-mergeconfig: $(O)/.config $(CONF_FILE)
- $(Q)$(CONFIG_SHELL) $(ZEPHYR_BASE)/scripts/kconfig/merge_config.sh \
- -q -m -O $(O) $(O)/.config $(CONF_FILE)
-else
-mergeconfig: defconfig $(CONF_FILE)
-endif
-
pristine:
$(Q)rm -rf $(O)
@@ -102,10 +79,10 @@ pristine:
$(Q)touch $@
-$(BEENTHERE): FORCE
- $(Q)rm -rf $(O)/.*.env
- $(Q)touch $@
+PHONY += FORCE
+PHONY += mergeconfig
+FORCE:
# Catch all
%: