diff options
author | Daniel Thompson <daniel.thompson@linaro.org> | 2016-09-19 17:47:46 +0100 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2016-10-10 01:44:23 +0300 |
commit | 2ea52cb045de021747c24ff7ed73e82a18be2aab (patch) | |
tree | c1102fd2d7e495f9a03be706f9619a8e3a9ee935 | |
parent | 7df9f313c687b5ff6965e01dcd2e9dfc50ffc354 (diff) | |
download | micropython-2ea52cb045de021747c24ff7ed73e82a18be2aab.tar.gz micropython-2ea52cb045de021747c24ff7ed73e82a18be2aab.zip |
zephyr: Automatically derive ARCH.
Currently to compile for anything that except ARCH=x86 we have to
provide ARCH via the environment or make arguments. We can do better
than that!
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
-rw-r--r-- | zephyr/Makefile | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/zephyr/Makefile b/zephyr/Makefile index 42897bcaf7..4bdfa9ff0a 100644 --- a/zephyr/Makefile +++ b/zephyr/Makefile @@ -9,13 +9,18 @@ # Zephyr build system. # -ARCH ?= x86 BOARD ?= qemu_x86 # Zephyr 1.5.0 #OUTDIR_PREFIX = # Zephyr 1.6.0 OUTDIR_PREFIX = $(BOARD) +Z_DOTCONFIG = outdir/$(OUTDIR_PREFIX)/.config +DQUOTE = " +# " +include $(Z_DOTCONFIG) +override ARCH = $(subst $(DQUOTE),,$(CONFIG_ARCH)) + # Zephyr toolchain config is 2-pass, so included twice include $(ZEPHYR_BASE)/scripts/Makefile.toolchain.$(ZEPHYR_GCC_VARIANT) include $(ZEPHYR_BASE)/scripts/Makefile.toolchain.$(ZEPHYR_GCC_VARIANT) @@ -50,6 +55,9 @@ CFLAGS = -std=gnu99 $(TOOLCHAIN_CFLAGS) $(INC) $(CFLAGS_MOD) $(COPT) $(CFLAGS_TA include ../py/mkrules.mk +$(Z_DOTCONFIG): + $(MAKE) -f Makefile.zephyr BOARD=$(BOARD) initconfig + all: $(LIBMICROPYTHON) $(MAKE) -f Makefile.zephyr BOARD=$(BOARD) |