Commit 2ea52cb0 authored by Daniel Thompson's avatar Daniel Thompson Committed by Paul Sokolovsky

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: default avatarDaniel Thompson <daniel.thompson@linaro.org>
parent 7df9f313
...@@ -9,13 +9,18 @@ ...@@ -9,13 +9,18 @@
# Zephyr build system. # Zephyr build system.
# #
ARCH ?= x86
BOARD ?= qemu_x86 BOARD ?= qemu_x86
# Zephyr 1.5.0 # Zephyr 1.5.0
#OUTDIR_PREFIX = #OUTDIR_PREFIX =
# Zephyr 1.6.0 # Zephyr 1.6.0
OUTDIR_PREFIX = $(BOARD) 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 # 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)
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 ...@@ -50,6 +55,9 @@ CFLAGS = -std=gnu99 $(TOOLCHAIN_CFLAGS) $(INC) $(CFLAGS_MOD) $(COPT) $(CFLAGS_TA
include ../py/mkrules.mk include ../py/mkrules.mk
$(Z_DOTCONFIG):
$(MAKE) -f Makefile.zephyr BOARD=$(BOARD) initconfig
all: $(LIBMICROPYTHON) all: $(LIBMICROPYTHON)
$(MAKE) -f Makefile.zephyr BOARD=$(BOARD) $(MAKE) -f Makefile.zephyr BOARD=$(BOARD)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment