Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
micropython/ports/bare-arm/Makefile
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
59 lines (45 sloc)
1.5 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Include the core environment definitions; this will set $(TOP). | |
include ../../py/mkenv.mk | |
# Include py core make definitions. | |
include $(TOP)/py/py.mk | |
# Set makefile-level MicroPython feature configurations. | |
MICROPY_ROM_TEXT_COMPRESSION ?= 1 | |
# Define toolchain and other tools. | |
CROSS_COMPILE ?= arm-none-eabi- | |
DFU ?= $(TOP)/tools/dfu.py | |
PYDFU ?= $(TOP)/tools/pydfu.py | |
# Set CFLAGS. | |
CFLAGS += -I. -I$(TOP) -I$(BUILD) | |
CFLAGS += -Wall -Werror -std=c99 -nostdlib | |
CFLAGS += -mthumb -mtune=cortex-m4 -mcpu=cortex-m4 -msoft-float | |
CSUPEROPT = -Os # save some code space for performance-critical code | |
# Select debugging or optimisation build. | |
ifeq ($(DEBUG), 1) | |
CFLAGS += -Og | |
else | |
CFLAGS += -Os -DNDEBUG | |
CFLAGS += -fdata-sections -ffunction-sections | |
endif | |
# Set linker flags. | |
LDFLAGS += -nostdlib -T stm32f405.ld --gc-sections | |
# Define the required source files. | |
SRC_C += lib.c main.c system.c | |
# Define the required object files. | |
OBJ += $(PY_CORE_O) | |
OBJ += $(addprefix $(BUILD)/, $(SRC_C:.c=.o)) | |
# Define the top-level target, the main firmware. | |
all: $(BUILD)/firmware.dfu | |
$(BUILD)/firmware.elf: $(OBJ) | |
$(ECHO) "LINK $@" | |
$(Q)$(LD) $(LDFLAGS) -o $@ $^ | |
$(Q)$(SIZE) $@ | |
$(BUILD)/firmware.bin: $(BUILD)/firmware.elf | |
$(ECHO) "Create $@" | |
$(Q)$(OBJCOPY) -O binary -j .isr_vector -j .text -j .data $^ $@ | |
$(BUILD)/firmware.dfu: $(BUILD)/firmware.bin | |
$(ECHO) "Create $@" | |
$(Q)$(PYTHON) $(DFU) -b 0x08000000:$^ $@ | |
deploy: $(BUILD)/firmware.dfu | |
$(Q)$(PYTHON) $(PYDFU) -u $^ | |
# Include remaining core make rules. | |
include $(TOP)/py/mkrules.mk |