From 3754e5c0126cf1989be3e70bc879d8b66ab3b65b Mon Sep 17 00:00:00 2001 From: Gabrielius Mickevicius Date: Sun, 28 Dec 2014 23:13:56 +0200 Subject: Let user skip MONITOR_PORT existance check Define FORCE_MONITOR_PORT to enable. Useful if one uses 'ssh root@remotemachine avrdude' instead of the usual AVRDUDE command. --- Arduino.mk | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'Arduino.mk') diff --git a/Arduino.mk b/Arduino.mk index b0bac01..014f69b 100644 --- a/Arduino.mk +++ b/Arduino.mk @@ -1031,11 +1031,16 @@ else $(call show_config_variable,DEVICE_PATH,[AUTODETECTED]) endif -# Returns the Arduino port (first wildcard expansion) if it exists, otherwise it errors. -ifeq ($(CURRENT_OS), WINDOWS) - get_monitor_port = $(COM_STYLE_MONITOR_PORT) +ifdef FORCE_MONITOR_PORT + # Skips the DEVICE_PATH existance check. + get_monitor_port = $(DEVICE_PATH) else - get_monitor_port = $(if $(wildcard $(DEVICE_PATH)),$(firstword $(wildcard $(DEVICE_PATH))),$(error Arduino port $(DEVICE_PATH) not found!)) + # Returns the Arduino port (first wildcard expansion) if it exists, otherwise it errors. + ifeq ($(CURRENT_OS), WINDOWS) + get_monitor_port = $(COM_STYLE_MONITOR_PORT) + else + get_monitor_port = $(if $(wildcard $(DEVICE_PATH)),$(firstword $(wildcard $(DEVICE_PATH))),$(error Arduino port $(DEVICE_PATH) not found!)) + endif endif # Returns the ISP port (first wildcard expansion) if it exists, otherwise it errors. -- cgit v1.2.3 From 3442ef8e6d5170d5acb8c987c135ec6d890b045b Mon Sep 17 00:00:00 2001 From: Gabrielius Mickevicius Date: Mon, 29 Dec 2014 00:24:51 +0200 Subject: Let 'build.core' from boards.txt change ARDUINO_CORE_PATH This is support for https://code.google.com/p/arduino-tiny The arduino-tiny project provides a boards.txt file and a whole separate Arduino core modified to work with attinies. Arduino.mk will now switch to that core if it finds a 'build.core' parameter in boards.txt and a folder in $(ALTERNATE_CORE_PATH)/cores by that name. --- Arduino.mk | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) (limited to 'Arduino.mk') diff --git a/Arduino.mk b/Arduino.mk index 014f69b..825bc3e 100644 --- a/Arduino.mk +++ b/Arduino.mk @@ -458,12 +458,6 @@ endif ARDUINO_LIB_PATH = $(ARDUINO_DIR)/libraries $(call show_config_variable,ARDUINO_LIB_PATH,[COMPUTED],(from ARDUINO_DIR)) -ifndef ARDUINO_CORE_PATH - ARDUINO_CORE_PATH = $(ARDUINO_DIR)/hardware/$(VENDOR)/$(ARCHITECTURE)/cores/arduino - $(call show_config_variable,ARDUINO_CORE_PATH,[DEFAULT]) -else - $(call show_config_variable,ARDUINO_CORE_PATH,[USER]) -endif # 1.5.x platform dependent libs path ifndef ARDUINO_PLATFORM_LIB_PATH @@ -565,6 +559,13 @@ endif # But the user might have to define MCU, F_CPU etc ifeq ($(strip $(NO_CORE)),) + # Select a core from the 'cores' directory. Two main values: 'arduino' or + # 'robot', but can also hold 'tiny', for example, if using + # https://code.google.com/p/arduino-tiny alternate core. + ifndef CORE + CORE = $(call PARSE_BOARD,$(BOARD_TAG),build.core) + endif + # Which variant ? This affects the include path ifndef VARIANT VARIANT = $(call PARSE_BOARD,$(BOARD_TAG),build.variant) @@ -689,6 +690,25 @@ else $(call show_config_variable,OBJDIR,[USER]) endif +# Now that we have ARDUINO_DIR, VENDOR, ARCHITECTURE and CORE, +# we can set ARDUINO_CORE_PATH. +ifndef ARDUINO_CORE_PATH + ifeq ($(strip $(CORE)),) + ARDUINO_CORE_PATH = $(ARDUINO_DIR)/hardware/$(VENDOR)/$(ARCHITECTURE)/cores/arduino + $(call show_config_variable,ARDUINO_CORE_PATH,[DEFAULT]) + else + ARDUINO_CORE_PATH = $(ALTERNATE_CORE_PATH)/cores/$(CORE) + ifeq ($(wildcard $(ARDUINO_CORE_PATH)),) + ARDUINO_CORE_PATH = $(ARDUINO_DIR)/hardware/$(VENDOR)/$(ARCHITECTURE)/cores/$(CORE) + $(call show_config_variable,ARDUINO_CORE_PATH,[COMPUTED],(from ARDUINO_DIR, BOARD_TAG and boards.txt)) + else + $(call show_config_variable,ARDUINO_CORE_PATH,[COMPUTED],(from ALTERNATE_CORE_PATH, BOARD_TAG and boards.txt)) + endif + endif +else + $(call show_config_variable,ARDUINO_CORE_PATH,[USER]) +endif + ######################################################################## # Reset -- cgit v1.2.3 From 6d549c89aa941b2f3dd4e99de553d38223e6a06a Mon Sep 17 00:00:00 2001 From: Gabrielius Mickevicius Date: Mon, 29 Dec 2014 19:34:45 +0200 Subject: Tidy new arduino mk vars Add CORE and FORCE_MONITOR_PORT to arduino-mk-vars.md and FORCE_MONITOR_PORT to config print. --- Arduino.mk | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Arduino.mk') diff --git a/Arduino.mk b/Arduino.mk index 825bc3e..8c878a4 100644 --- a/Arduino.mk +++ b/Arduino.mk @@ -1051,6 +1051,12 @@ else $(call show_config_variable,DEVICE_PATH,[AUTODETECTED]) endif +ifndef FORCE_MONITOR_PORT + $(call show_config_variable,FORCE_MONITOR_PORT,[DEFAULT]) +else + $(call show_config_variable,FORCE_MONITOR_PORT,[USER]) +endif + ifdef FORCE_MONITOR_PORT # Skips the DEVICE_PATH existance check. get_monitor_port = $(DEVICE_PATH) -- cgit v1.2.3 From e639f81b6c52b2092a4682cdc93efe5832c3e879 Mon Sep 17 00:00:00 2001 From: Gabrielius Mickevicius Date: Tue, 30 Dec 2014 17:40:15 +0200 Subject: Fix build.core parsing Disregard anything before first colon. E.g. build.core = arduino:arduino results in CORE = arduino Print CORE. --- Arduino.mk | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Arduino.mk') diff --git a/Arduino.mk b/Arduino.mk index 8c878a4..a5b9bba 100644 --- a/Arduino.mk +++ b/Arduino.mk @@ -563,7 +563,10 @@ ifeq ($(strip $(NO_CORE)),) # 'robot', but can also hold 'tiny', for example, if using # https://code.google.com/p/arduino-tiny alternate core. ifndef CORE - CORE = $(call PARSE_BOARD,$(BOARD_TAG),build.core) + CORE = $(shell echo $(call PARSE_BOARD,$(BOARD_TAG),build.core) | cut -d : -f 2) + $(call show_config_variable,CORE,[COMPUTED],(from build.core)) + else + $(call show_config_variable,CORE,[USER]) endif # Which variant ? This affects the include path -- cgit v1.2.3