makefile for stm32

The official pyboard running MicroPython.
This is the reference design and main target board for MicroPython.
You can buy one at the store.
Target audience: Users with a pyboard.
Post Reply
terrancepeiris
Posts: 9
Joined: Mon Sep 10, 2018 6:05 am

makefile for stm32

Post by terrancepeiris » Sat Sep 15, 2018 5:23 am

by terrancepeiris » Fri Sep 14, 2018 8:10 pm
https://github.com/MarkR42/micropython/ ... l/Makefile

I notice that the latest (2018 Sep 2018) STM32hal make file is slightly different from 2016

2018 make file

ifneq ($(FROZEN_DIR),)
# To use frozen source modules, put your .py files in a subdirectory (eg scripts/)
# and then invoke make with FROZEN_DIR=scripts (be sure to build from scratch).
CFLAGS += -DMICROPY_MODULE_FROZEN_STR
endif


2016 make file
ifneq ($(FROZEN_MPY_DIR),)

# To use frozen bytecode, put your .py files in a subdirectory (eg frozen/) and

# then invoke make with FROZEN_MPY_DIR=frozen (be sure to build from scratch).

FROZEN_MPY_PY_FILES := $(shell find $(FROZEN_MPY_DIR) -type f -name '*.py')

FROZEN_MPY_MPY_FILES := $(addprefix $(BUILD)/,$(FROZEN_MPY_PY_FILES:.py=.mpy))

CFLAGS += -DMICROPY_QSTR_EXTRA_POOL=mp_qstr_frozen_const_pool

CFLAGS += -DMICROPY_MODULE_FROZEN_MPY

OBJ += $(BUILD)/$(BUILD)/frozen_mpy.o

MPY_CROSS = ../mpy-cross/mpy-cross

MPY_TOOL = ../tools/mpy-tool.py

$(BUILD)/$(FROZEN_MPY_DIR)/%.mpy: $(FROZEN_MPY_DIR)/%.py

@$(ECHO) "MPY $<"

$(Q)$(MKDIR) -p $(dir $@)

$(Q)$(MPY_CROSS) -o $@ -s $(^:$(FROZEN_MPY_DIR)/%=%) $^

$(BUILD)/frozen_mpy.c: $(FROZEN_MPY_MPY_FILES) $(BUILD)/genhdr/qstrdefs.generated.h

@$(ECHO) "Creating $@"

$(Q)$(PYTHON) $(MPY_TOOL) -f -q $(BUILD)/genhdr/qstrdefs.preprocessed.h $(FROZEN_MPY_MPY_FILES) > $@
endif

Post Reply