File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55# recursively Makefile.zephyr to build complete application binary
66# using Zephyr build system.
77#
8+ # To build a "minimal" configuration, use "make-minimal" wrapper.
89
910BOARD ?= qemu_x86
10- ifeq ($(MAKECMDGOALS ) , minimal)
11- # For minimal, CONF_FILE must be overriden early due to $(Z_EXPORTS) target
12- CONF_FILE = prj_minimal.conf
13- else
1411CONF_FILE = prj.conf
15- endif
16- # Zephyr 1.5.0
17- # OUTDIR_PREFIX =
18- # Zephyr 1.6.0
1912OUTDIR_PREFIX = $(BOARD )
2013
2114# Default heap size is 16KB, which is on conservative side, to let
@@ -66,7 +59,7 @@ include ../py/mkrules.mk
6659$(Z_EXPORTS ) : $(CONF_FILE )
6760 $(MAKE ) -f Makefile.zephyr BOARD=$(BOARD ) CONF_FILE=$(CONF_FILE ) initconfig outputexports
6861
69- GENERIC_TARGETS = all zephyr qemu qemugdb flash debug
62+ GENERIC_TARGETS = all zephyr run qemu qemugdb flash debug
7063KCONFIG_TARGETS = \
7164 initconfig config nconfig menuconfig xconfig gconfig \
7265 oldconfig silentoldconfig defconfig savedefconfig \
@@ -88,12 +81,6 @@ $(Z_SYSGEN_H):
8881 rm -f $(LIBMICROPYTHON )
8982 -$(MAKE ) -f Makefile.zephyr BOARD=$(BOARD ) CONF_FILE=$(CONF_FILE )
9083
91- minimal :
92- $(MAKE ) BOARD=$(BOARD ) CONF_FILE=prj_minimal.conf CFLAGS_EXTRA=' -DMP_CONFIGFILE="<mpconfigport_minimal.h>"' FROZEN_DIR=
93-
94- qemu-minimal :
95- $(MAKE ) -f Makefile.zephyr BOARD=$(BOARD ) CONF_FILE=prj_minimal.conf QEMU_NET=0 run
96-
9784# Clean Zephyr things too
9885clean : z_clean
9986
Original file line number Diff line number Diff line change @@ -98,17 +98,17 @@ below 128KB, as long as Zephyr project is committed to maintain stable
9898minimal size of their kernel (which they appear to be). Note that at such
9999size, there is no support for any Zephyr features beyond REPL over UART,
100100and only very minimal set of builtin Python modules. Thus, this build
101- is more suitable for code size control and quick demonstrations even on
101+ is more suitable for code size control and quick demonstrations on
102102smaller systems. It's also suitable for careful enabling of features one
103- by one to achieve needed functionality and code size. This is in contrast
104- to the "default" build, which may get more and more features enabled by
105- default over time.
103+ by one to achieve needed functionality and code size. This is in a
104+ contrast to the "default" build, which may get more and more features
105+ enabled over time.
106106
107107To make a minimal build:
108108
109- make BOARD=<board> minimal
109+ ./ make-minimal BOARD=<board>
110110
111111To run a minimal build in QEMU without requiring TAP networking setup
112112run the following after you built image with the previous command:
113113
114- make BOARD=<qemu_x86|qemu_cortex_m3> qemu-minimal
114+ ./ make-minimal BOARD=<qemu_x86|qemu_cortex_m3> qemu
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+ #
3+ # This is a wrapper for make to build a "minimal" Zephyr port.
4+ # It should be run just like make (i.e. extra vars can be passed on the
5+ # command line, etc.), e.g.:
6+ #
7+ # ./make-minimal BOARD=qemu_cortex_m3
8+ # ./make-minimal BOARD=qemu_cortex_m3 run
9+ #
10+
11+ make \
12+ CONF_FILE=prj_minimal.conf \
13+ CFLAGS_EXTRA=' -DMP_CONFIGFILE="<mpconfigport_minimal.h>"' \
14+ FROZEN_DIR= \
15+ QEMU_NET=0 \
16+ " $@ "
You can’t perform that action at this time.
0 commit comments