Kbuild: New mergeconfig target.

This commit adds the mergeconfig target.
The mergeconfig target merges the current .config file with the
prj_<ARCH>.conf configuration file and updates the current
configuration of the project.

Change-Id: Ia7112147ffbc033d7860369241188af13b53b334
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
This commit is contained in:
Juan Manuel Cruz 2015-05-05 17:21:55 -05:00 committed by Anas Nashif
parent b25405283f
commit 9e4b2bb18e

View file

@ -1,11 +1,15 @@
PROJECT_BASE = $(shell pwd)
ARCH?=x86
export ARCH CFLAGS LDFLAGS KBUILD_DEFCONFIG
export ARCH VPFILE
CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
else if [ -x /bin/bash ]; then echo /bin/bash; \
else echo sh; fi ; fi)
all: FORCE
$(Q)$(MAKE) -C $(TIMO_BASE) O=$(PROJECT_BASE) \
PROJECT=$(PROJECT_BASE) VPFILE=$(VPFILE)
PROJECT=$(PROJECT_BASE)
rm-files:= final-linker.cmd linker.cmd modules.order \
staticIdt.o System.map *kernel.lnk \
@ -19,15 +23,22 @@ clean: FORCE
mrproper: clean
$(Q)$(MAKE) -C $(TIMO_BASE) \
PROJECT=$(PROJECT_BASE) VPFILE=$(VPFILE) mrproper
PROJECT=$(PROJECT_BASE) mrproper
%config: FORCE
$(Q)$(MAKE) -C $(TIMO_BASE) O=$(PROJECT_BASE) \
PROJECT=$(PROJECT_BASE) VPFILE=$(VPFILE) $@
PROJECT=$(PROJECT_BASE) $@
qemu: FORCE
$(Q)$(MAKE) -C $(TIMO_BASE) O=$(PROJECT_BASE) \
PROJECT=$(PROJECT_BASE) VPFILE=$(VPFILE) qemu
PROJECT=$(PROJECT_BASE) qemu
mergeconfig:
$(Q)$(CONFIG_SHELL) $(TIMO_BASE)/scripts/kconfig/merge_config.sh \
-m -O $(PROJECT_BASE) $(PROJECT_BASE)/.config $(PROJECT_BASE)/prj_$(ARCH).conf
$(Q)yes "" | $(MAKE) -C $(TIMO_BASE) O=$(PROJECT_BASE) \
PROJECT=$(PROJECT_BASE) oldconfig
PHONY += FORCE
FORCE: