Skip to content

Instantly share code, notes, and snippets.

@mgcrea mgcrea/teensy.diff
Created Mar 16, 2015

Embed
What would you like to do?
diff --git a/Teensy.mk b/Teensy.mk
index 8a441e7..39ff771 100644
--- a/Teensy.mk
+++ b/Teensy.mk
@@ -34,8 +34,8 @@ endif
include $(ARDMK_DIR)/Common.mk
VENDOR = teensy
-ARDUINO_CORE_PATH = $(ARDUINO_DIR)/hardware/teensy/cores/teensy3
-BOARDS_TXT = $(ARDUINO_DIR)/hardware/$(VENDOR)/boards.txt
+ARDUINO_CORE_PATH = $(ARDUINO_DIR)/hardware/$(VENDOR)/avr/cores/teensy3
+BOARDS_TXT = $(ARDUINO_DIR)/hardware/$(VENDOR)/avr/boards.txt
ifndef F_CPU
F_CPU=96000000
@@ -135,28 +135,21 @@ endif
########################################################################
# FLAGS
-ifndef USB_TYPE
- USB_TYPE = USB_SERIAL
-endif
-
-CPPFLAGS += -DLAYOUT_US_ENGLISH -D$(USB_TYPE)
-CPPFLAGS += $(call PARSE_TEENSY,$(BOARD_TAG),build.option)
+CPPFLAGS := -O $(call PARSE_TEENSY,$(BOARD_TAG),build.flags.common)
+CPPFLAGS += $(call PARSE_TEENSY,$(BOARD_TAG),build.flags.cpp)
+CPUFLAGS := $(call PARSE_TEENSY,$(BOARD_TAG),build.flags.cpu)
+DEFSFLAGS += $(call PARSE_TEENSY,$(BOARD_TAG),build.flags.defs)
+DEFSFLAGS += -DARDUINO=10601 -DF_CPU=96000000 -DARDUINO_ARCH_AVR -DUSB_SERIAL -DLAYOUT_US_ENGLISH
+OPTIMIZATION_FLAGS = $(call PARSE_TEENSY,$(BOARD_TAG),build.flags.optimize)
-CXXFLAGS += $(call PARSE_TEENSY,$(BOARD_TAG),build.cppoption)
+CXXFLAGS :=
+#CXXFLAGS += $(call PARSE_TEENSY,$(BOARD_TAG),build.flags.cpp)
ifeq ("$(call PARSE_TEENSY,$(BOARD_TAG),build.gnu0x)","true")
CXXFLAGS_STD += -std=gnu++0x
endif
-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)
-
-ifneq ("$(call PARSE_TEENSY,$(BOARD_TAG),build.linkscript)",)
- LDFLAGS += -T$(ARDUINO_CORE_PATH)/$(call PARSE_TEENSY,$(BOARD_TAG),build.linkscript)
-endif
+LDFLAGS := $(call PARSE_TEENSY,$(BOARD_TAG),build.flags.ld)
########################################################################
# some fairly odd settings so that 'make upload' works
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.