Add PLATFORM_PATH
Add PLATFORM_PATH variable to the root hardware directory for a given architecture to avoid duplication between boards.txt, cores, platform libraries, etc.
This commit is contained in:
parent
e870443f48
commit
90ea5a0c7f
2 changed files with 31 additions and 7 deletions
17
Arduino.mk
17
Arduino.mk
|
@ -420,15 +420,20 @@ ifdef ALTERNATE_CORE_PATH
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
|
ifndef PLATFORM_PATH
|
||||||
|
PLATFORM_PATH = $(ARDUINO_DIR)/hardware/$(ARDMK_VENDOR)/$(ARCHITECTURE)
|
||||||
|
$(call show_config_variable,PLATFORM_PATH,[COMPUTED],(from ARDUINO_DIR))
|
||||||
|
endif
|
||||||
|
|
||||||
ifndef ARDUINO_VAR_PATH
|
ifndef ARDUINO_VAR_PATH
|
||||||
ARDUINO_VAR_PATH = $(ARDUINO_DIR)/hardware/$(ARDMK_VENDOR)/$(ARCHITECTURE)/variants
|
ARDUINO_VAR_PATH = $(PLATFORM_PATH)/variants
|
||||||
$(call show_config_variable,ARDUINO_VAR_PATH,[COMPUTED],(from ARDUINO_DIR))
|
$(call show_config_variable,ARDUINO_VAR_PATH,[COMPUTED],(from ARDUINO_DIR))
|
||||||
else
|
else
|
||||||
$(call show_config_variable,ARDUINO_VAR_PATH,[USER])
|
$(call show_config_variable,ARDUINO_VAR_PATH,[USER])
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifndef BOARDS_TXT
|
ifndef BOARDS_TXT
|
||||||
BOARDS_TXT = $(ARDUINO_DIR)/hardware/$(ARDMK_VENDOR)/$(ARCHITECTURE)/boards.txt
|
BOARDS_TXT = $(PLATFORM_PATH)/boards.txt
|
||||||
$(call show_config_variable,BOARDS_TXT,[COMPUTED],(from ARDUINO_DIR))
|
$(call show_config_variable,BOARDS_TXT,[COMPUTED],(from ARDUINO_DIR))
|
||||||
else
|
else
|
||||||
$(call show_config_variable,BOARDS_TXT,[USER])
|
$(call show_config_variable,BOARDS_TXT,[USER])
|
||||||
|
@ -602,7 +607,7 @@ endif
|
||||||
ifndef ARDUINO_PLATFORM_LIB_PATH
|
ifndef ARDUINO_PLATFORM_LIB_PATH
|
||||||
ifeq ($(shell expr $(ARDUINO_VERSION) '>' 150), 1)
|
ifeq ($(shell expr $(ARDUINO_VERSION) '>' 150), 1)
|
||||||
# only for 1.5
|
# only for 1.5
|
||||||
ARDUINO_PLATFORM_LIB_PATH = $(ARDUINO_DIR)/hardware/$(ARDMK_VENDOR)/$(ARCHITECTURE)/libraries
|
ARDUINO_PLATFORM_LIB_PATH = $(PLATFORM_PATH)/libraries
|
||||||
$(call show_config_variable,ARDUINO_PLATFORM_LIB_PATH,[COMPUTED],(from ARDUINO_DIR))
|
$(call show_config_variable,ARDUINO_PLATFORM_LIB_PATH,[COMPUTED],(from ARDUINO_DIR))
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
|
@ -834,12 +839,12 @@ endif
|
||||||
# we can set ARDUINO_CORE_PATH.
|
# we can set ARDUINO_CORE_PATH.
|
||||||
ifndef ARDUINO_CORE_PATH
|
ifndef ARDUINO_CORE_PATH
|
||||||
ifeq ($(strip $(CORE)),)
|
ifeq ($(strip $(CORE)),)
|
||||||
ARDUINO_CORE_PATH = $(ARDUINO_DIR)/hardware/$(ARDMK_VENDOR)/$(ARCHITECTURE)/cores/arduino
|
ARDUINO_CORE_PATH = $(PLATFORM_PATH)/cores/arduino
|
||||||
$(call show_config_variable,ARDUINO_CORE_PATH,[DEFAULT])
|
$(call show_config_variable,ARDUINO_CORE_PATH,[DEFAULT])
|
||||||
else
|
else
|
||||||
ARDUINO_CORE_PATH = $(ALTERNATE_CORE_PATH)/cores/$(CORE)
|
ARDUINO_CORE_PATH = $(ALTERNATE_CORE_PATH)/cores/$(CORE)
|
||||||
ifeq ($(wildcard $(ARDUINO_CORE_PATH)),)
|
ifeq ($(wildcard $(ARDUINO_CORE_PATH)),)
|
||||||
ARDUINO_CORE_PATH = $(ARDUINO_DIR)/hardware/$(ARDMK_VENDOR)/$(ARCHITECTURE)/cores/$(CORE)
|
ARDUINO_CORE_PATH = $(PLATFORM_PATH)/cores/$(CORE)
|
||||||
$(call show_config_variable,ARDUINO_CORE_PATH,[COMPUTED],(from ARDUINO_DIR, BOARD_TAG and boards.txt))
|
$(call show_config_variable,ARDUINO_CORE_PATH,[COMPUTED],(from ARDUINO_DIR, BOARD_TAG and boards.txt))
|
||||||
else
|
else
|
||||||
$(call show_config_variable,ARDUINO_CORE_PATH,[COMPUTED],(from ALTERNATE_CORE_PATH, BOARD_TAG and boards.txt))
|
$(call show_config_variable,ARDUINO_CORE_PATH,[COMPUTED],(from ALTERNATE_CORE_PATH, BOARD_TAG and boards.txt))
|
||||||
|
@ -1322,7 +1327,7 @@ endif
|
||||||
|
|
||||||
# either calculate parent dir from arduino dir, or user-defined path
|
# either calculate parent dir from arduino dir, or user-defined path
|
||||||
ifndef BOOTLOADER_PARENT
|
ifndef BOOTLOADER_PARENT
|
||||||
BOOTLOADER_PARENT = $(ARDUINO_DIR)/hardware/$(ARDMK_VENDOR)/$(ARCHITECTURE)/bootloaders
|
BOOTLOADER_PARENT = $(PLATFORM_PATH)/bootloaders
|
||||||
$(call show_config_variable,BOOTLOADER_PARENT,[COMPUTED],(from ARDUINO_DIR))
|
$(call show_config_variable,BOOTLOADER_PARENT,[COMPUTED],(from ARDUINO_DIR))
|
||||||
else
|
else
|
||||||
$(call show_config_variable,BOOTLOADER_PARENT,[USER])
|
$(call show_config_variable,BOOTLOADER_PARENT,[USER])
|
||||||
|
|
|
@ -288,6 +288,25 @@ ARDUINO_CORE_PATH = /usr/share/arduino/hardware/arduino/cores/arduino
|
||||||
|
|
||||||
----
|
----
|
||||||
|
|
||||||
|
### PLATFORM_PATH
|
||||||
|
|
||||||
|
**Description:**
|
||||||
|
|
||||||
|
Root directory of your ARCHITECTURE that contains configuration and build files for its hardware. (Hint: It will contain a platform.txt file at the first level.) Changing this will change the parent dir of ARDUINO_VAR_PATH, BOARDS_TXT, ARDUINO_PLATFORM_LIB_PATH, ARDUINO_CORE_PATH and BOOTLOADER_PARENT.
|
||||||
|
|
||||||
|
Note: not used when setting ALTERNATE_CORE or ALTERNATE_CORE_PATH.
|
||||||
|
|
||||||
|
Defaults to: ARDUINO_DIR/hardware/ARDMK_VENDOR/ARCHITECTURE
|
||||||
|
|
||||||
|
**Example:**
|
||||||
|
|
||||||
|
```Makefile
|
||||||
|
PLATFORM_PATH = $(HOME)/sketchbook/hardware/arduino-tiny
|
||||||
|
```
|
||||||
|
|
||||||
|
**Requirement:** *Optional*
|
||||||
|
----
|
||||||
|
|
||||||
## Sketch related variables
|
## Sketch related variables
|
||||||
|
|
||||||
### ARDUINO_LIBS
|
### ARDUINO_LIBS
|
||||||
|
|
Loading…
Reference in a new issue