Skip to content

Commit 2ea52cb

Browse files
Daniel Thompsonpfalcon
authored andcommitted
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>
1 parent 7df9f31 commit 2ea52cb

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

zephyr/Makefile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,18 @@
99
# Zephyr build system.
1010
#
1111

12-
ARCH ?= x86
1312
BOARD ?= qemu_x86
1413
# Zephyr 1.5.0
1514
#OUTDIR_PREFIX =
1615
# Zephyr 1.6.0
1716
OUTDIR_PREFIX = $(BOARD)
1817

18+
Z_DOTCONFIG = outdir/$(OUTDIR_PREFIX)/.config
19+
DQUOTE = "
20+
# "
21+
include $(Z_DOTCONFIG)
22+
override ARCH = $(subst $(DQUOTE),,$(CONFIG_ARCH))
23+
1924
# Zephyr toolchain config is 2-pass, so included twice
2025
include $(ZEPHYR_BASE)/scripts/Makefile.toolchain.$(ZEPHYR_GCC_VARIANT)
2126
include $(ZEPHYR_BASE)/scripts/Makefile.toolchain.$(ZEPHYR_GCC_VARIANT)
@@ -50,6 +55,9 @@ CFLAGS = -std=gnu99 $(TOOLCHAIN_CFLAGS) $(INC) $(CFLAGS_MOD) $(COPT) $(CFLAGS_TA
5055

5156
include ../py/mkrules.mk
5257

58+
$(Z_DOTCONFIG):
59+
$(MAKE) -f Makefile.zephyr BOARD=$(BOARD) initconfig
60+
5361
all: $(LIBMICROPYTHON)
5462
$(MAKE) -f Makefile.zephyr BOARD=$(BOARD)
5563

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy