70a7d7a943
The autogenerated header files have been moved about, and an extra include dir has been added, which means you can give a custom BUILD=newbuilddir option to make, and everything "just works" Also tidied up the way the different Makefiles build their include- directory flags
49 lines
981 B
Makefile
49 lines
981 B
Makefile
include ../py/mkenv.mk
|
|
|
|
# qstr definitions (must come before including py.mk)
|
|
QSTR_DEFS = qstrdefsport.h
|
|
|
|
# include py core make definitions
|
|
include ../py/py.mk
|
|
|
|
CROSS_COMPILE = arm-none-eabi-
|
|
|
|
INC = -I.
|
|
INC += -I$(PY_SRC)
|
|
INC += -I$(BUILD)/includes
|
|
|
|
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
|
|
CFLAGS = $(INC) -Wall -Werror -ansi -std=gnu99 $(CFLAGS_CORTEX_M4) $(COPT)
|
|
|
|
#Debugging/Optimization
|
|
ifeq ($(DEBUG), 1)
|
|
CFLAGS += -O0 -ggdb
|
|
else
|
|
CFLAGS += -Os -DNDEBUG
|
|
endif
|
|
|
|
LDFLAGS = --nostdlib -T stm32f405.ld
|
|
LIBS =
|
|
|
|
SRC_C = \
|
|
main.c \
|
|
# printf.c \
|
|
string0.c \
|
|
malloc0.c \
|
|
gccollect.c \
|
|
|
|
SRC_S = \
|
|
# startup_stm32f40xx.s \
|
|
gchelper.s \
|
|
|
|
OBJ = $(PY_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o) $(SRC_S:.s=.o))
|
|
|
|
all: $(BUILD)/flash.elf
|
|
|
|
$(BUILD)/flash.elf: $(OBJ)
|
|
$(ECHO) "LINK $@"
|
|
$(Q)$(LD) $(LDFLAGS) -o $@ $(OBJ) $(LIBS)
|
|
$(Q)$(SIZE) $@
|
|
|
|
include ../py/mkrules.mk
|