2017-09-06 05:09:13 +01:00
|
|
|
include ../../py/mkenv.mk
|
2014-04-12 13:07:45 +01:00
|
|
|
|
|
|
|
# qstr definitions (must come before including py.mk)
|
|
|
|
QSTR_DEFS = qstrdefsport.h
|
|
|
|
|
ports: Enable error text compression for various ports, but not all.
Enabled on: bare-arm, minimal, unix coverage/dev/minimal, stm32, esp32,
esp8266, cc3200, teensy, qemu-arm, nrf. Not enabled on others to be able
to test the code when the feature is disabled (the default case).
Code size change for this commit:
bare-arm: -600 -0.906%
minimal x86: -308 -0.208%
unix x64: +0 +0.000%
unix nanbox: +0 +0.000%
stm32: -3368 -0.869% PYBV10
cc3200: -1024 -0.558%
esp8266: -2512 -0.368% GENERIC
esp32: -2876 -0.205% GENERIC[incl -3168(data)]
nrf: -1708 -1.173% pca10040
samd: +0 +0.000% ADAFRUIT_ITSYBITSY_M4_EXPRESS
2020-03-04 10:56:44 +00:00
|
|
|
# MicroPython feature configurations
|
|
|
|
MICROPY_ROM_TEXT_COMPRESSION ?= 1
|
|
|
|
|
2014-04-12 13:07:45 +01:00
|
|
|
# include py core make definitions
|
2017-08-11 03:22:19 +01:00
|
|
|
include $(TOP)/py/py.mk
|
2014-04-12 13:07:45 +01:00
|
|
|
|
2019-12-21 20:22:26 +00:00
|
|
|
CROSS_COMPILE ?= arm-none-eabi-
|
2014-04-12 13:07:45 +01:00
|
|
|
|
2015-10-19 16:22:16 +01:00
|
|
|
INC += -I.
|
2017-08-11 03:22:19 +01:00
|
|
|
INC += -I$(TOP)
|
2014-04-17 18:03:27 +01:00
|
|
|
INC += -I$(BUILD)
|
2014-04-16 22:10:33 +01:00
|
|
|
|
2014-04-12 13:07:45 +01:00
|
|
|
CFLAGS_CORTEX_M4 = -mthumb -mtune=cortex-m4 -mabi=aapcs-linux -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -fsingle-precision-constant -Wdouble-promotion
|
2017-03-23 04:41:04 +00:00
|
|
|
CFLAGS = $(INC) -Wall -Werror -std=c99 -nostdlib $(CFLAGS_CORTEX_M4) $(COPT)
|
2019-09-12 13:14:51 +01:00
|
|
|
CSUPEROPT = -Os # save some code space
|
2014-04-12 13:07:45 +01:00
|
|
|
|
|
|
|
#Debugging/Optimization
|
|
|
|
ifeq ($(DEBUG), 1)
|
|
|
|
CFLAGS += -O0 -ggdb
|
|
|
|
else
|
|
|
|
CFLAGS += -Os -DNDEBUG
|
|
|
|
endif
|
|
|
|
|
2014-06-27 16:58:31 +01:00
|
|
|
LDFLAGS = -nostdlib -T stm32f405.ld -Map=$@.map --cref
|
2014-04-12 13:07:45 +01:00
|
|
|
LIBS =
|
|
|
|
|
|
|
|
SRC_C = \
|
|
|
|
main.c \
|
|
|
|
# printf.c \
|
|
|
|
string0.c \
|
|
|
|
malloc0.c \
|
|
|
|
gccollect.c \
|
|
|
|
|
|
|
|
SRC_S = \
|
|
|
|
# startup_stm32f40xx.s \
|
|
|
|
gchelper.s \
|
|
|
|
|
2018-02-22 00:15:48 +00:00
|
|
|
OBJ = $(PY_CORE_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o) $(SRC_S:.s=.o))
|
2014-04-12 13:07:45 +01:00
|
|
|
|
2014-05-10 13:45:47 +01:00
|
|
|
all: $(BUILD)/firmware.elf
|
2014-04-12 13:07:45 +01:00
|
|
|
|
2014-05-10 13:45:47 +01:00
|
|
|
$(BUILD)/firmware.elf: $(OBJ)
|
2014-04-12 13:07:45 +01:00
|
|
|
$(ECHO) "LINK $@"
|
2015-10-24 00:26:10 +01:00
|
|
|
$(Q)$(LD) $(LDFLAGS) -o $@ $^ $(LIBS)
|
2014-04-12 13:07:45 +01:00
|
|
|
$(Q)$(SIZE) $@
|
|
|
|
|
2017-08-11 03:22:19 +01:00
|
|
|
include $(TOP)/py/mkrules.mk
|