From 12a759ba8b95456d2f438f1d6b82145ae790ae68 Mon Sep 17 00:00:00 2001 From: Christopher Peplin Date: Fri, 30 Mar 2012 15:58:23 -0400 Subject: [PATCH] Don't ignore custom boards.txt path when using a custom ard-parse-boards. This splits the definition of the path to ard-parse-boards from the arguments passed to it - most importantly the custom path to the boards.txt which changes on different platforms. The default value for this hard-coded into ard-parse-boards won't work in Linux or Windows, so passing the custom value is critical. This change also determines the absolute path to ard-parse-boards dynamically, so the PARSE_BOARDS_PATH value should never really need to be overridden. I removed the custom values from all of the example Makefiles. --- arduino-mk/Arduino.mk | 13 ++++++++++++- examples/Blink/Makefile | 1 - examples/BlinkWithoutDelay/Makefile | 3 +-- examples/Fade/Makefile | 3 +-- examples/HelloWorld/Makefile | 5 +---- examples/WebServer/Makefile | 3 +-- examples/master_reader/Makefile | 1 - examples/toneMelody/Makefile | 1 - 8 files changed, 16 insertions(+), 14 deletions(-) diff --git a/arduino-mk/Arduino.mk b/arduino-mk/Arduino.mk index 2d39095..cb36048 100644 --- a/arduino-mk/Arduino.mk +++ b/arduino-mk/Arduino.mk @@ -173,6 +173,9 @@ endif ######################################################################## +# The path directory this Makefile is stored in +ARDUINO_MK_PATH := $(dir $(lastword $(MAKEFILE_LIST))) + # # Arduino version number ifndef ARDUINO_VERSION @@ -214,8 +217,16 @@ ifndef BOARDS_TXT BOARDS_TXT = $(ARDUINO_DIR)/hardware/arduino/boards.txt endif +ifndef PARSE_BOARD_OPTS +PARSE_BOARD_OPTS = --boards_txt=$(BOARDS_TXT) +endif + +ifndef PARSE_BOARD_PATH +PARSE_BOARD_PATH = $(ARDUINO_MK_PATH)/ard-parse-boards +endif + ifndef PARSE_BOARD -PARSE_BOARD = ard-parse-boards --boards_txt=$(BOARDS_TXT) +PARSE_BOARD = $(PARSE_BOARD_PATH) $(PARSE_BOARD_OPTS) endif # Which variant ? This affects the include path diff --git a/examples/Blink/Makefile b/examples/Blink/Makefile index 12cd3e6..3f9d938 100644 --- a/examples/Blink/Makefile +++ b/examples/Blink/Makefile @@ -1,5 +1,4 @@ ARDUINO_DIR = /Applications/Arduino.app/Contents/Resources/Java -PARSE_BOARD = ../../arduino-mk/ard-parse-boards BOARD_TAG = uno ARDUINO_PORT = /dev/cu.usb* diff --git a/examples/BlinkWithoutDelay/Makefile b/examples/BlinkWithoutDelay/Makefile index 5c8c1dd..e84232c 100644 --- a/examples/BlinkWithoutDelay/Makefile +++ b/examples/BlinkWithoutDelay/Makefile @@ -1,9 +1,8 @@ ARDUINO_DIR = /Applications/Arduino.app/Contents/Resources/Java -PARSE_BOARD = ../../arduino-mk/ard-parse-boards BOARD_TAG = uno ARDUINO_PORT = /dev/cu.usb* ARDUINO_LIBS = -include ../../arduino-mk/Arduino.mk \ No newline at end of file +include ../../arduino-mk/Arduino.mk diff --git a/examples/Fade/Makefile b/examples/Fade/Makefile index 5c8c1dd..e84232c 100644 --- a/examples/Fade/Makefile +++ b/examples/Fade/Makefile @@ -1,9 +1,8 @@ ARDUINO_DIR = /Applications/Arduino.app/Contents/Resources/Java -PARSE_BOARD = ../../arduino-mk/ard-parse-boards BOARD_TAG = uno ARDUINO_PORT = /dev/cu.usb* ARDUINO_LIBS = -include ../../arduino-mk/Arduino.mk \ No newline at end of file +include ../../arduino-mk/Arduino.mk diff --git a/examples/HelloWorld/Makefile b/examples/HelloWorld/Makefile index 591d575..c6b5108 100644 --- a/examples/HelloWorld/Makefile +++ b/examples/HelloWorld/Makefile @@ -1,9 +1,6 @@ -ARDUINO_DIR = /Applications/Arduino.app/Contents/Resources/Java -PARSE_BOARD = ../../arduino-mk/ard-parse-boards - BOARD_TAG = uno ARDUINO_PORT = /dev/cu.usb* ARDUINO_LIBS = LiquidCrystal -include ../../arduino-mk/Arduino.mk \ No newline at end of file +include ../../arduino-mk/Arduino.mk diff --git a/examples/WebServer/Makefile b/examples/WebServer/Makefile index 56e422f..a7ca436 100644 --- a/examples/WebServer/Makefile +++ b/examples/WebServer/Makefile @@ -1,9 +1,8 @@ ARDUINO_DIR = /Applications/Arduino.app/Contents/Resources/Java -PARSE_BOARD = ../../arduino-mk/ard-parse-boards BOARD_TAG = uno ARDUINO_PORT = /dev/cu.usb* ARDUINO_LIBS = Ethernet Ethernet/utility SPI -include ../../arduino-mk/Arduino.mk \ No newline at end of file +include ../../arduino-mk/Arduino.mk diff --git a/examples/master_reader/Makefile b/examples/master_reader/Makefile index 7e744c1..e0fcdaf 100644 --- a/examples/master_reader/Makefile +++ b/examples/master_reader/Makefile @@ -1,5 +1,4 @@ ARDUINO_DIR = /Applications/Arduino.app/Contents/Resources/Java -PARSE_BOARD = ../../arduino-mk/ard-parse-boards BOARD_TAG = uno ARDUINO_PORT = /dev/cu.usb* diff --git a/examples/toneMelody/Makefile b/examples/toneMelody/Makefile index 17d67e8..e84232c 100644 --- a/examples/toneMelody/Makefile +++ b/examples/toneMelody/Makefile @@ -1,5 +1,4 @@ ARDUINO_DIR = /Applications/Arduino.app/Contents/Resources/Java -PARSE_BOARD = ../../arduino-mk/ard-parse-boards BOARD_TAG = uno ARDUINO_PORT = /dev/cu.usb*