aboutsummaryrefslogtreecommitdiff
path: root/arduino-mk/Arduino.mk
diff options
context:
space:
mode:
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