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.
This commit is contained in:
parent
cc4e64a650
commit
66a56f4f38
1 changed files with 26 additions and 6 deletions
32
Arduino.mk
32
Arduino.mk
|
@ -458,12 +458,6 @@ endif
|
||||||
|
|
||||||
ARDUINO_LIB_PATH = $(ARDUINO_DIR)/libraries
|
ARDUINO_LIB_PATH = $(ARDUINO_DIR)/libraries
|
||||||
$(call show_config_variable,ARDUINO_LIB_PATH,[COMPUTED],(from ARDUINO_DIR))
|
$(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
|
# 1.5.x platform dependent libs path
|
||||||
ifndef ARDUINO_PLATFORM_LIB_PATH
|
ifndef ARDUINO_PLATFORM_LIB_PATH
|
||||||
|
@ -565,6 +559,13 @@ endif
|
||||||
# But the user might have to define MCU, F_CPU etc
|
# But the user might have to define MCU, F_CPU etc
|
||||||
ifeq ($(strip $(NO_CORE)),)
|
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
|
# Which variant ? This affects the include path
|
||||||
ifndef VARIANT
|
ifndef VARIANT
|
||||||
VARIANT = $(call PARSE_BOARD,$(BOARD_TAG),build.variant)
|
VARIANT = $(call PARSE_BOARD,$(BOARD_TAG),build.variant)
|
||||||
|
@ -697,6 +698,25 @@ else
|
||||||
$(call show_config_variable,OBJDIR,[USER])
|
$(call show_config_variable,OBJDIR,[USER])
|
||||||
endif
|
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
|
# Reset
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue