diff options
| author | Sudar Muthu <sudar@sudarmuthu.com> | 2016-11-09 07:27:07 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-11-09 07:27:07 +0530 |
| commit | 2c1155e156ac0cbfb5c02033efb841597c5004f0 (patch) | |
| tree | 348c40c56a84c6559b5f8e03ab498ca9b30a063a /Teensy.mk | |
| parent | 23556d759cfaf94b7ed4a996f177412833e55387 (diff) | |
| parent | 7d564b6a26ffaaf270b80fa10deb9d4d732c1aae (diff) | |
Merge pull request #468 from georgeharker/master
Update to work with Arduino 1.6.12 and Teensyduino 1.30
Diffstat (limited to 'Teensy.mk')
| -rw-r--r-- | Teensy.mk | 43 |
1 files changed, 37 insertions, 6 deletions
@@ -34,8 +34,8 @@ endif include $(ARDMK_DIR)/Common.mk ARDMK_VENDOR = teensy -ARDUINO_CORE_PATH = $(ARDUINO_DIR)/hardware/teensy/cores/teensy3 -BOARDS_TXT = $(ARDUINO_DIR)/hardware/$(ARDMK_VENDOR)/boards.txt +ARDUINO_CORE_PATH = $(ARDUINO_DIR)/hardware/teensy/avr/cores/teensy3 +BOARDS_TXT = $(ARDUINO_DIR)/hardware/$(ARDMK_VENDOR)/avr/boards.txt ifndef F_CPU F_CPU=96000000 @@ -46,9 +46,20 @@ ifndef PARSE_TEENSY PARSE_TEENSY = $(shell grep -v "^\#" "$(BOARDS_TXT)" | grep $(1).$(2) | cut -d = -f 2,3 ) endif +# if boards.txt gets modified, look there, else hard code it ARCHITECTURE = $(call PARSE_TEENSY,$(BOARD_TAG),build.architecture) +ifeq ($(strip $(ARCHITECTURE)),) + ARCHITECTURE = arm +endif + AVR_TOOLS_DIR = $(call dir_if_exists,$(ARDUINO_DIR)/hardware/tools/$(ARCHITECTURE)) +# define plaform lib dir ignoring teensy's oversight on putting it all in avr +ifndef ARDUINO_PLATFORM_LIB_PATH + ARDUINO_PLATFORM_LIB_PATH = $(ARDUINO_DIR)/hardware/$(ARDMK_VENDOR)/avr/libraries + $(call show_config_variable,ARDUINO_PLATFORM_LIB_PATH,[COMPUTED],(from ARDUINO_DIR)) +endif + ######################################################################## # command names @@ -152,11 +163,30 @@ ifeq ("$(call PARSE_TEENSY,$(BOARD_TAG),build.elide_constructors)", "true") CXXFLAGS += -felide-constructors endif -LDFLAGS += $(call PARSE_TEENSY,$(BOARD_TAG),build.linkoption) $(call PARSE_TEENSY,$(BOARD_TAG),build.additionalobject) +CXXFLAGS += $(call PARSE_TEENSY,$(BOARD_TAG),build.flags.common) +CXXFLAGS += $(call PARSE_TEENSY,$(BOARD_TAG),build.flags.cpu) +CXXFLAGS += $(call PARSE_TEENSY,$(BOARD_TAG),build.flags.defs) +CXXFLAGS += $(call PARSE_TEENSY,$(BOARD_TAG),build.flags.cpp) -ifneq ("$(call PARSE_TEENSY,$(BOARD_TAG),build.linkscript)",) - LDFLAGS += -T$(ARDUINO_CORE_PATH)/$(call PARSE_TEENSY,$(BOARD_TAG),build.linkscript) -endif +CFLAGS += $(call PARSE_TEENSY,$(BOARD_TAG),build.flags.common) +CFLAGS += $(call PARSE_TEENSY,$(BOARD_TAG),build.flags.cpu) +CFLAGS += $(call PARSE_TEENSY,$(BOARD_TAG),build.flags.defs) + +ASFLAGS += $(call PARSE_TEENSY,$(BOARD_TAG),build.flags.common) +ASFLAGS += $(call PARSE_TEENSY,$(BOARD_TAG),build.flags.cpu) +ASFLAGS += $(call PARSE_TEENSY,$(BOARD_TAG),build.flags.defs) +ASFLAGS += $(call PARSE_TEENSY,$(BOARD_TAG),build.flags.S) + +LDFLAGS += $(call PARSE_TEENSY,$(BOARD_TAG),build.flags.cpu) + +AMCU := $(call PARSE_TEENSY,$(BOARD_TAG),build.mcu) +LDFLAGS += -Wl,--gc-sections,--relax +LINKER_SCRIPTS = -T${ARDUINO_CORE_PATH}/${AMCU}.ld +OTHER_LIBS = $(call PARSE_TEENSY,$(BOARD_TAG),build.flags.libs) + +CPUFLAGS = $(call PARSE_TEENSY,$(BOARD_TAG),build.flags.cpu) +# usually defined as per teensy31.build.mcu=mk20dx256 but that isn't valid switch +MCU := $(shell echo ${CPUFLAGS} | sed -n -e 's/.*-mcpu=\([a-zA-Z0-9_-]*\).*/\1/p') ######################################################################## # some fairly odd settings so that 'make upload' works @@ -171,3 +201,4 @@ RESET_CMD = nohup $(ARDUINO_DIR)/hardware/tools/teensy_post_compile -board=$(BOA # automatially include Arduino.mk for the user include $(ARDMK_DIR)/Arduino.mk + |
