diff options
| author | Sudar Muthu <sudar@sudarmuthu.com> | 2020-09-03 07:22:54 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-03 07:22:54 +0530 |
| commit | e6881e2a43f02e0abf22bf28abc46b3c2e406d84 (patch) | |
| tree | 78df2b3c6e1fc185f13199add4f784026c58f6b6 /Arduino.mk | |
| parent | 6f786a96b0acfb0c9b2d2f4e39911d2803088729 (diff) | |
| parent | 2329d19b97a3a3a115b6a414a6235f5d398bae2b (diff) | |
Merge pull request #640 from tuna-f1sh/travis
Fix Travis CI, add SAMD test support, support GNU grep on macOS
Diffstat (limited to 'Arduino.mk')
| -rw-r--r-- | Arduino.mk | 29 |
1 files changed, 19 insertions, 10 deletions
@@ -853,15 +853,15 @@ endif # Reset ifndef RESET_CMD - ARD_RESET_ARDUINO := $(shell which ard-reset-arduino 2> /dev/null) + ARD_RESET_ARDUINO := $(PYTHON_CMD) $(shell which ard-reset-arduino 2> /dev/null) ifndef ARD_RESET_ARDUINO # same level as *.mk in bin directory when checked out from git # or in $PATH when packaged - ARD_RESET_ARDUINO = $(ARDMK_DIR)/bin/ard-reset-arduino + ARD_RESET_ARDUINO = $(PYTHON_CMD) $(ARDMK_DIR)/bin/ard-reset-arduino endif ifneq (,$(findstring CYGWIN,$(shell uname -s))) # confirm user is using default cygwin unix Python (which uses ttySx) and not Windows Python (which uses COMx) - ifeq ($(shell which python),/usr/bin/python) + ifeq ($(PYTHON_CMD),/usr/bin/python) RESET_CMD = $(ARD_RESET_ARDUINO) $(ARD_RESET_OPTS) $(DEVICE_PATH) else RESET_CMD = $(ARD_RESET_ARDUINO) $(ARD_RESET_OPTS) $(call get_monitor_port) @@ -1227,15 +1227,24 @@ CFLAGS += $(CFLAGS_STD) CXXFLAGS += -fpermissive -fno-exceptions $(CXXFLAGS_STD) ASFLAGS += -x assembler-with-cpp DIAGNOSTICS_COLOR_WHEN ?= always -ifeq ($(shell expr $(CC_VERNUM) '>' 490), 1) - ASFLAGS += -flto - CXXFLAGS += -fno-threadsafe-statics -flto -fno-devirtualize -fdiagnostics-color=$(DIAGNOSTICS_COLOR_WHEN) - CFLAGS += -flto -fno-fat-lto-objects -fdiagnostics-color=$(DIAGNOSTICS_COLOR_WHEN) + +# Flags for AVR +ifeq ($(findstring avr, $(strip $(CC_NAME))), avr) + ifeq ($(shell expr $(CC_VERNUM) '>' 490), 1) + ASFLAGS += -flto + CXXFLAGS += -fno-threadsafe-statics -flto -fno-devirtualize -fdiagnostics-color=$(DIAGNOSTICS_COLOR_WHEN) + CFLAGS += -flto -fno-fat-lto-objects -fdiagnostics-color=$(DIAGNOSTICS_COLOR_WHEN) + LDFLAGS += -flto -fuse-linker-plugin + endif +# Flags for ARM (most set in Sam.mk) +else + ifeq ($(shell expr $(CC_VERNUM) '>' 490), 1) + CXXFLAGS += -fdiagnostics-color=$(DIAGNOSTICS_COLOR_WHEN) + CFLAGS += -fdiagnostics-color=$(DIAGNOSTICS_COLOR_WHEN) + endif endif + LDFLAGS += -$(MCU_FLAG_NAME)=$(MCU) -Wl,--gc-sections -O$(OPTIMIZATION_LEVEL) -ifeq ($(shell expr $(CC_VERNUM) '>' 490), 1) - LDFLAGS += -flto -fuse-linker-plugin -endif SIZEFLAGS ?= --mcu=$(MCU) -C # for backwards compatibility, grab ARDUINO_PORT if the user has it set |
