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 ifeq ($(ARDUINO),) $(error Please define ARDUINO (where TeensyDuino is installed)) endif TOOLS_PATH = $(ARDUINO)/hardware/tools COMPILER_PATH = $(TOOLS_PATH)/arm-none-eabi/bin CORE_PATH = $(ARDUINO)/hardware/teensy/cores/teensy3 CROSS_COMPILE = $(COMPILER_PATH)/arm-none-eabi- CFLAGS_TEENSY = -DF_CPU=96000000 -DUSB_SERIAL -D__MK20DX256__ CFLAGS_CORTEX_M4 = -mthumb -mtune=cortex-m4 -mcpu=cortex-m4 -fsingle-precision-constant -Wdouble-promotion $(CFLAGS_TEENSY) INC = -I. INC += -I$(PY_SRC) INC += -I../stmhal INC += -I$(BUILD) INC += -I$(CORE_PATH) CFLAGS = $(INC) -Wall -ansi -std=gnu99 $(CFLAGS_CORTEX_M4) LDFLAGS = -nostdlib -T mk20dx256.ld LIBS = -L $(COMPILER_PATH)/../arm-none-eabi/lib/thumb2 -lm LIBS += -L $(COMPILER_PATH)/../arm-none-eabi/lib/thumb2 -lc LIBS += -L $(COMPILER_PATH)/../lib/gcc/arm-none-eabi/4.7.2/thumb2 -lgcc #Debugging/Optimization ifdef DEBUG CFLAGS += -Og -ggdb else CFLAGS += -Os #-DNDEBUG endif SRC_C = \ hal_gpio.c \ help.c \ import.c \ main.c \ lcd.c \ led.c \ lexermemzip.c \ memzip.c \ modpyb.c \ teensy_hal.c \ uart.c \ usb.c \ STM_SRC_C = $(addprefix stmhal/,\ gccollect.c \ input.c \ pin.c \ pin_named_pins.c \ printf.c \ pyexec.c \ pybstdio.c \ readline.c \ string0.c \ ) STM_SRC_S = $(addprefix stmhal/,\ gchelper.s \ ) SRC_TEENSY = \ mk20dx128.c \ pins_teensy.c \ analog.c \ usb_desc.c \ usb_dev.c \ usb_mem.c \ usb_serial.c \ yield.c \ OBJ = $(PY_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o) $(STM_SRC_C:.c=.o) $(STM_SRC_S:.s=.o) $(SRC_TEENSY:.c=.o)) OBJ += $(BUILD)/pins_gen.o all: hex hex: $(BUILD)/micropython-mz.hex post_compile: $(BUILD)/micropython-mz.hex $(ECHO) "Preparing $@ for upload" $(Q)$(TOOLS_PATH)/teensy_post_compile -file="$(basename $( $(GEN_PINS_SRC) $(BUILD)/pins_gen.o: $(BUILD)/pins_gen.c $(call compile_c) $(BUILD)/%.pp: $(BUILD)/%.c $(ECHO) "PreProcess $<" $(Q)$(CC) $(CFLAGS) -E -Wp,-C,-dD,-dI -o $@ $< include ../py/mkrules.mk