2017-09-06 00:09:13 -04:00
|
|
|
include ../../py/mkenv.mk
|
2014-04-12 08:07:45 -04:00
|
|
|
|
|
|
|
# qstr definitions (must come before including py.mk)
|
|
|
|
QSTR_DEFS = qstrdefsport.h
|
|
|
|
|
|
|
|
# include py core make definitions
|
2017-08-10 22:22:19 -04:00
|
|
|
include $(TOP)/py/py.mk
|
2014-04-12 08:07:45 -04:00
|
|
|
|
|
|
|
CROSS_COMPILE = arm-none-eabi-
|
|
|
|
|
2015-10-19 11:22:16 -04:00
|
|
|
INC += -I.
|
2017-08-10 22:22:19 -04:00
|
|
|
INC += -I$(TOP)
|
2014-04-17 13:03:27 -04:00
|
|
|
INC += -I$(BUILD)
|
2014-04-16 17:10:33 -04:00
|
|
|
|
2014-04-12 08:07:45 -04: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 00:41:04 -04:00
|
|
|
CFLAGS = $(INC) -Wall -Werror -std=c99 -nostdlib $(CFLAGS_CORTEX_M4) $(COPT)
|
2014-04-12 08:07:45 -04:00
|
|
|
|
|
|
|
#Debugging/Optimization
|
|
|
|
ifeq ($(DEBUG), 1)
|
|
|
|
CFLAGS += -O0 -ggdb
|
|
|
|
else
|
|
|
|
CFLAGS += -Os -DNDEBUG
|
|
|
|
endif
|
|
|
|
|
2014-06-27 11:58:31 -04:00
|
|
|
LDFLAGS = -nostdlib -T stm32f405.ld -Map=$@.map --cref
|
2014-04-12 08:07:45 -04:00
|
|
|
LIBS =
|
|
|
|
|
|
|
|
SRC_C = \
|
|
|
|
main.c \
|
|
|
|
# printf.c \
|
|
|
|
string0.c \
|
|
|
|
malloc0.c \
|
|
|
|
gccollect.c \
|
|
|
|
|
|
|
|
SRC_S = \
|
|
|
|
# startup_stm32f40xx.s \
|
|
|
|
gchelper.s \
|
|
|
|
|
2018-02-21 19:15:48 -05:00
|
|
|
OBJ = $(PY_CORE_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o) $(SRC_S:.s=.o))
|
2014-04-12 08:07:45 -04:00
|
|
|
|
2014-05-10 08:45:47 -04:00
|
|
|
all: $(BUILD)/firmware.elf
|
2014-04-12 08:07:45 -04:00
|
|
|
|
2014-05-10 08:45:47 -04:00
|
|
|
$(BUILD)/firmware.elf: $(OBJ)
|
2014-04-12 08:07:45 -04:00
|
|
|
$(ECHO) "LINK $@"
|
2015-10-23 19:26:10 -04:00
|
|
|
$(Q)$(LD) $(LDFLAGS) -o $@ $^ $(LIBS)
|
2014-04-12 08:07:45 -04:00
|
|
|
$(Q)$(SIZE) $@
|
|
|
|
|
2017-08-10 22:22:19 -04:00
|
|
|
include $(TOP)/py/mkrules.mk
|