2016-07-22 18:18:17 +01:00
|
|
|
#
|
|
|
|
# This is main Makefile, which uses MicroPython build system, but
|
|
|
|
# Zephyr arch-specific toolchain (setup by Zephyr's Makefile.toolchain.*).
|
|
|
|
# Unfortunately, it's currently not possible to get target (as in: specific
|
|
|
|
# board to run on) specific compile-time options from Zephyr, so these must
|
|
|
|
# be set (duplicated) in this Makefile. Currently, these configured for
|
|
|
|
# ARM Cortex-M3. This Makefile builds MicroPython as a library, and then
|
|
|
|
# calls recursively Makefile.zephyr to build complete application using
|
|
|
|
# Zephyr build system.
|
|
|
|
#
|
|
|
|
|
|
|
|
BOARD ?= qemu_x86
|
|
|
|
# Zephyr 1.5.0
|
|
|
|
#OUTDIR_PREFIX =
|
|
|
|
# Zephyr 1.6.0
|
|
|
|
OUTDIR_PREFIX = $(BOARD)
|
|
|
|
|
2016-09-17 19:15:58 +01:00
|
|
|
FROZEN_DIR = scripts
|
|
|
|
|
2016-09-22 22:42:18 +01:00
|
|
|
# Zephyr (generated) config files - must be defined before include below
|
2016-09-19 17:47:46 +01:00
|
|
|
Z_SYSGEN_H = outdir/$(OUTDIR_PREFIX)/misc/generated/sysgen/sysgen.h
|
|
|
|
Z_EXPORTS = outdir/$(OUTDIR_PREFIX)/Makefile.export
|
|
|
|
include $(Z_EXPORTS)
|
2016-07-22 18:18:17 +01:00
|
|
|
|
|
|
|
include ../py/mkenv.mk
|
|
|
|
include ../py/py.mk
|
|
|
|
|
|
|
|
INC += -I.
|
|
|
|
INC += -I..
|
|
|
|
INC += -I$(BUILD)
|
2016-09-19 17:47:46 +01:00
|
|
|
INC += -I$(ZEPHYR_BASE)/net/ip
|
|
|
|
INC += -I$(ZEPHYR_BASE)/net/ip/contiki
|
|
|
|
INC += -I$(ZEPHYR_BASE)/net/ip/contiki/os
|
2016-07-22 18:18:17 +01:00
|
|
|
|
|
|
|
SRC_C = main.c \
|
|
|
|
uart_core.c \
|
|
|
|
lib/utils/stdout_helpers.c \
|
|
|
|
lib/utils/printf.c \
|
|
|
|
lib/utils/pyexec.c \
|
|
|
|
lib/mp-readline/readline.c \
|
2016-09-17 19:15:58 +01:00
|
|
|
$(BUILD)/frozen.c \
|
2016-07-22 18:18:17 +01:00
|
|
|
$(SRC_MOD)
|
|
|
|
|
|
|
|
OBJ = $(PY_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o))
|
|
|
|
|
2016-09-19 17:47:46 +01:00
|
|
|
CFLAGS = $(KBUILD_CFLAGS) $(NOSTDINC_FLAGS) $(ZEPHYRINCLUDE) \
|
|
|
|
-std=gnu99 -DNDEBUG $(INC)
|
2016-07-22 18:18:17 +01:00
|
|
|
|
|
|
|
include ../py/mkrules.mk
|
|
|
|
|
2016-09-19 17:47:46 +01:00
|
|
|
$(Z_EXPORTS):
|
|
|
|
$(MAKE) -f Makefile.zephyr BOARD=$(BOARD) initconfig outputexports
|
2016-09-19 17:47:46 +01:00
|
|
|
|
2016-09-19 19:04:53 +01:00
|
|
|
GENERIC_TARGETS = all zephyr qemu qemugdb flash debug
|
2016-09-19 17:47:46 +01:00
|
|
|
KCONFIG_TARGETS = \
|
|
|
|
initconfig config nconfig menuconfig xconfig gconfig \
|
|
|
|
oldconfig silentoldconfig defconfig savedefconfig \
|
|
|
|
allnoconfig allyesconfig alldefconfig randconfig \
|
|
|
|
listnewconfig olddefconfig
|
|
|
|
CLEAN_TARGETS = pristine mrproper
|
|
|
|
|
|
|
|
$(GENERIC_TARGETS): $(LIBMICROPYTHON)
|
|
|
|
$(CLEAN_TARGETS): clean
|
|
|
|
|
|
|
|
$(GENERIC_TARGETS) $(KCONFIG_TARGETS) $(CLEAN_TARGETS):
|
|
|
|
$(RM) -f outdir/$(OUTDIR_PREFIX)/zephyr.lnk
|
2016-09-19 19:04:53 +01:00
|
|
|
$(MAKE) -f Makefile.zephyr BOARD=$(BOARD) $@
|
2016-07-22 18:18:17 +01:00
|
|
|
|
2016-09-19 17:47:46 +01:00
|
|
|
$(LIBMICROPYTHON): $(Z_SYSGEN_H)
|
|
|
|
build/genhdr/qstr.i.last: $(Z_SYSGEN_H)
|
2016-07-22 18:18:17 +01:00
|
|
|
|
2016-09-19 17:47:46 +01:00
|
|
|
$(Z_SYSGEN_H):
|
2016-07-22 18:18:17 +01:00
|
|
|
rm -f $(LIBMICROPYTHON)
|
|
|
|
-$(MAKE) -f Makefile.zephyr BOARD=$(BOARD)
|
|
|
|
|
|
|
|
# Clean Zephyr things too
|
2016-09-19 17:47:46 +01:00
|
|
|
clean: z_clean
|
|
|
|
|
|
|
|
z_clean:
|
|
|
|
$(MAKE) -f Makefile.zephyr BOARD=$(BOARD) clean
|