@@ -20,15 +20,15 @@ FROZEN_DIR = scripts
20
20
# Default target
21
21
all :
22
22
23
+ include ../../py/mkenv.mk
24
+ include $(TOP ) /py/py.mk
25
+
23
26
# Zephyr (generated) config files - must be defined before include below
24
27
Z_EXPORTS = outdir/$(OUTDIR_PREFIX ) /Makefile.export
25
28
ifneq ($(MAKECMDGOALS ) , clean)
26
29
include $(Z_EXPORTS )
27
30
endif
28
31
29
- include ../../py/mkenv.mk
30
- include $(TOP ) /py/py.mk
31
-
32
32
INC += -I.
33
33
INC += -I$(TOP )
34
34
INC += -I$(BUILD )
@@ -56,19 +56,11 @@ SRC_QSTR += $(SRC_C)
56
56
57
57
OBJ = $(PY_O ) $(addprefix $(BUILD ) /, $(SRC_C:.c=.o ) )
58
58
59
- CFLAGS = $(KBUILD_CFLAGS ) $( NOSTDINC_FLAGS ) $( ZEPHYRINCLUDE ) \
59
+ CFLAGS = $(Z_CFLAGS ) \
60
60
-std=gnu99 -fomit-frame-pointer -DNDEBUG -DMICROPY_HEAP_SIZE=$(MICROPY_HEAP_SIZE ) $(CFLAGS_EXTRA ) $(INC )
61
61
62
62
include $(TOP ) /py/mkrules.mk
63
63
64
- # We use single target here ($(Z_EXPORTS)) for simplicity, but actually
65
- # number of things get generated here: 'initconfig' generates C header for
66
- # Kconfig configuration, 'outputexports' generates make environment with CC,
67
- # etc., and 'lib' generates other headers which may be included by zephyr.h,
68
- # e.g. DTS-related.
69
- $(Z_EXPORTS ) : $(CONF_FILE )
70
- $(MAKE ) -f Makefile.zephyr BOARD=$(BOARD ) CONF_FILE=$(CONF_FILE ) initconfig outputexports lib
71
-
72
64
GENERIC_TARGETS = all zephyr run qemu qemugdb flash debug debugserver
73
65
KCONFIG_TARGETS = \
74
66
initconfig config nconfig menuconfig xconfig gconfig \
@@ -81,7 +73,7 @@ $(GENERIC_TARGETS): $(LIBMICROPYTHON)
81
73
$(CLEAN_TARGETS ) : clean
82
74
83
75
$(GENERIC_TARGETS ) $(KCONFIG_TARGETS ) $(CLEAN_TARGETS ) :
84
- $(MAKE ) -f Makefile.zephyr BOARD= $(BOARD ) CONF_FILE= $( CONF_FILE ) $@
76
+ $(MAKE ) -C outdir/ $(BOARD ) $@
85
77
86
78
$(LIBMICROPYTHON ) : | $(Z_EXPORTS )
87
79
build/genhdr/qstr.i.last : | $(Z_EXPORTS )
@@ -103,3 +95,11 @@ prj_$(BOARD)_merged.conf: prj_base.conf prj_$(BOARD).conf
103
95
104
96
test :
105
97
cd $(TOP ) /tests && ./run-tests --target minimal --device " execpty:make -C ../ports/zephyr run BOARD=$( BOARD) QEMU_PTY=1"
98
+
99
+ cmake : outdir/$(BOARD ) /Makefile
100
+
101
+ outdir/$(BOARD ) /Makefile : $(CONF_FILE )
102
+ mkdir -p outdir/$(BOARD ) && cmake -DBOARD=$(BOARD ) -DCONF_FILE=$(CONF_FILE ) -Boutdir/$(BOARD ) -H.
103
+
104
+ $(Z_EXPORTS ) : outdir/$(BOARD ) /Makefile
105
+ make --no-print-directory -C outdir/$(BOARD ) outputexports CMAKE_COMMAND=: > $@
0 commit comments