aboutsummaryrefslogtreecommitdiff
path: root/arduino-mk/Arduino.mk
diff options
context:
space:
mode:
authorSudar <sudar@sudarmuthu.com>2013-06-29 21:40:36 +0530
committerSudar <sudar@sudarmuthu.com>2013-06-29 21:40:36 +0530
commit45f230c5c8f33c31d9d2af0d5ab629a3332c1fcb (patch)
tree6e3e586ca6283489104a61cf7e24ca0007bdbb45 /arduino-mk/Arduino.mk
parent96deb9cd06be8b90e57d141b79881c3bb24e11df (diff)
Improve avrdude and avrdude_conf path auto detection
In Arduino Linux distribution, avrdude and avrdude.conf files are placed in different path. This commit improves the autodetection of avrdude and avrdude.conf paths by considering this fact. Fix #48
Diffstat (limited to 'arduino-mk/Arduino.mk')
-rw-r--r--arduino-mk/Arduino.mk45
1 files changed, 26 insertions, 19 deletions
diff --git a/arduino-mk/Arduino.mk b/arduino-mk/Arduino.mk
index 4943af0..3e98c9f 100644
--- a/arduino-mk/Arduino.mk
+++ b/arduino-mk/Arduino.mk
@@ -326,11 +326,27 @@ ifndef AVR_TOOLS_DIR
AVR_TOOLS_DIR = $(BUNDLED_AVR_TOOLS_DIR)
$(call show_config_variable,AVR_TOOLS_DIR,[BUNDLED],(in Arduino distribution))
- # if AVRDUDE_CONF is already defined, don't overwrite it
- ifndef AVRDUDE_CONF
- # The avrdude bundled with Arduino can't find it's config
- AVRDUDE_CONF = $(AVR_TOOLS_DIR)/etc/avrdude.conf
- endif
+ # In Linux distribution of Arduino, the path to avrdude and avrdude.conf are different
+ # More details at https://github.com/sudar/Arduino-Makefile/issues/48 and
+ # https://groups.google.com/a/arduino.cc/d/msg/developers/D_m97jGr8Xs/uQTt28KO_8oJ
+ ifeq ($(CURRENT_OS),LINUX)
+
+ ifndef AVRDUDE
+ AVRDUDE = $(AVR_TOOLS_DIR)/../avrdude
+ endif
+
+ ifndef AVRDUDE_CONF
+ AVRDUDE_CONF = $(AVR_TOOLS_DIR)/../avrdude.conf
+ endif
+
+ else
+
+ ifndef AVRDUDE_CONF
+ AVRDUDE_CONF = $(AVR_TOOLS_DIR)/etc/avrdude.conf
+ endif
+
+ endif
+
else
SYSTEMPATH_AVR_TOOLS_DIR := $(call dir_if_exists,$(abspath $(dir $(shell which avr-gcc))/..))
@@ -345,6 +361,10 @@ else
$(call show_config_variable,AVR_TOOLS_DIR,[USER])
endif #ndef AVR_TOOLS_DIR
+ifndef AVR_TOOLS_PATH
+ AVR_TOOLS_PATH = $(AVR_TOOLS_DIR)/bin
+endif
+
ARDUINO_LIB_PATH = $(ARDUINO_DIR)/libraries
$(call show_config_variable,ARDUINO_LIB_PATH,[COMPUTED],(from ARDUINO_DIR))
ARDUINO_CORE_PATH = $(ARDUINO_DIR)/hardware/arduino/cores/arduino
@@ -394,12 +414,6 @@ else
endif
-ifdef AVR_TOOLS_DIR
- ifndef AVR_TOOLS_PATH
- AVR_TOOLS_PATH = $(AVR_TOOLS_DIR)/bin
- endif
-endif
-
########################################################################
# Makefile distribution path
#
@@ -881,19 +895,12 @@ $(OBJDIR)/%.sym: $(OBJDIR)/%.elf $(COMMON_DEPS)
########################################################################
#
# Avrdude
+# If avrdude is installed separately, it can find its own config file
#
ifndef AVRDUDE
AVRDUDE = $(AVR_TOOLS_PATH)/avrdude
endif
-ifndef AVRDUDE_CONF
- ifndef AVR_TOOLS_DIR
- # The avrdude bundled with Arduino can't find its config
- AVRDUDE_CONF = $(AVR_TOOLS_DIR)/etc/avrdude.conf
- endif
- # If avrdude is installed separately, it can find its own config file
-endif
-
# Default avrdude options. -V Do not verify, -q - suppress progress output
ifndef AVRDUDE_OPTS
AVRDUDE_OPTS = -q -V