Don't overwrite AVRDUDE_CONF if AVR_TOOLS_DIR is not set.

If one likes to use avrdude from outside of Arduino together with
Arduino-bundled gcc crosstolchain, the setting of AVRDUDE_CONF got
overwritten.
This commit is contained in:
Ralf Doering 2013-06-25 20:04:11 +02:00
parent 74882aa13a
commit 25a31afbd9

View file

@ -306,10 +306,12 @@ ifndef AVR_TOOLS_DIR
BUNDLED_AVR_TOOLS_DIR := $(call dir_if_exists,$(ARDUINO_DIR)/hardware/tools/avr) BUNDLED_AVR_TOOLS_DIR := $(call dir_if_exists,$(ARDUINO_DIR)/hardware/tools/avr)
ifdef BUNDLED_AVR_TOOLS_DIR ifdef BUNDLED_AVR_TOOLS_DIR
AVR_TOOLS_DIR = $(BUNDLED_AVR_TOOLS_DIR) AVR_TOOLS_DIR = $(BUNDLED_AVR_TOOLS_DIR)
# if AVRDUDE_CONF is already defined, don't overwrite it
ifndef AVRDUDE_CONF
# The avrdude bundled with Arduino can't find it's config # The avrdude bundled with Arduino can't find it's config
AVRDUDE_CONF = $(AVR_TOOLS_DIR)/etc/avrdude.conf AVRDUDE_CONF = $(AVR_TOOLS_DIR)/etc/avrdude.conf
$(call show_config_variable,AVR_TOOLS_DIR,[BUNDLED],(in Arduino distribution)) $(call show_config_variable,AVR_TOOLS_DIR,[BUNDLED],(in Arduino distribution))
endif
else else
SYSTEMPATH_AVR_TOOLS_DIR := $(call dir_if_exists,$(abspath $(dir $(shell which avr-gcc))/..)) SYSTEMPATH_AVR_TOOLS_DIR := $(call dir_if_exists,$(abspath $(dir $(shell which avr-gcc))/..))