Made all the changes into one commit that could be a patch for master

This commit is contained in:
Simon John 2014-06-01 17:14:38 +01:00
parent 542529ae4f
commit 8cdae73deb
3 changed files with 150 additions and 14 deletions

View file

@ -311,6 +311,30 @@ else
$(call show_config_variable,ARDUINO_VERSION,[USER]) $(call show_config_variable,ARDUINO_VERSION,[USER])
endif endif
########################################################################
# 1.5.x architecture - avr or sam for arduino vendor
ifndef ARCHITECTURE
ifeq ($(shell expr $(ARDUINO_VERSION) '>' 150), 1)
# default to avr for 1.5
ARCHITECTURE = avr
else
# unset for 1.0
ARCHITECTURE =
endif
$(call show_config_variable,ARCHITECTURE,[DEFAULT])
else
$(call show_config_variable,ARCHITECTURE,[USER])
endif
########################################################################
# 1.5.x vendor - defaults to arduino
ifndef VENDOR
VENDOR = arduino
$(call show_config_variable,VENDOR,[DEFAULT])
else
$(call show_config_variable,VENDOR,[USER])
endif
######################################################################## ########################################################################
# Arduino Sketchbook folder # Arduino Sketchbook folder
@ -437,7 +461,7 @@ 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 ifndef ARDUINO_CORE_PATH
ARDUINO_CORE_PATH = $(ARDUINO_DIR)/hardware/arduino/cores/arduino ARDUINO_CORE_PATH = $(ARDUINO_DIR)/hardware/$(VENDOR)/$(ARCHITECTURE)/cores/arduino
$(call show_config_variable,ARDUINO_CORE_PATH,[DEFAULT]) $(call show_config_variable,ARDUINO_CORE_PATH,[DEFAULT])
else else
$(call show_config_variable,ARDUINO_CORE_PATH,[USER]) $(call show_config_variable,ARDUINO_CORE_PATH,[USER])
@ -473,14 +497,14 @@ ifdef ALTERNATE_CORE_PATH
else else
ifndef ARDUINO_VAR_PATH ifndef ARDUINO_VAR_PATH
ARDUINO_VAR_PATH = $(ARDUINO_DIR)/hardware/arduino/variants ARDUINO_VAR_PATH = $(ARDUINO_DIR)/hardware/$(VENDOR)/$(ARCHITECTURE)/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/arduino/boards.txt BOARDS_TXT = $(ARDUINO_DIR)/hardware/$(VENDOR)/$(ARCHITECTURE)/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])
@ -508,6 +532,11 @@ endif
######################################################################## ########################################################################
# boards.txt parsing # boards.txt parsing
ifdef BOARD_SUB
BOARD_SUB := $(strip $(BOARD_SUB))
$(call show_config_variable,BOARD_SUB,[USER])
endif
ifndef BOARD_TAG ifndef BOARD_TAG
BOARD_TAG = uno BOARD_TAG = uno
$(call show_config_variable,BOARD_TAG,[DEFAULT]) $(call show_config_variable,BOARD_TAG,[DEFAULT])
@ -533,15 +562,31 @@ ifeq ($(strip $(NO_CORE)),)
endif endif
# see if we are a caterina device like leonardo or micro # see if we are a caterina device like leonardo or micro
CATERINA = $(findstring caterina,$(call PARSE_BOARD,$(BOARD_TAG),bootloader.path)) CATERINA := $(findstring caterina,$(call PARSE_BOARD,$(BOARD_TAG),bootloader.path))
ifndef CATERINA
# bootloader.path is deprecated in 1.5, its now part of bootloader.file
CATERINA := $(findstring caterina,$(call PARSE_BOARD,$(BOARD_TAG),bootloader.file))
endif
ifndef CATERINA
# might be a submenu
CATERINA := $(findstring caterina,$(call PARSE_BOARD,$(BOARD_TAG),menu.cpu.$(BOARD_SUB).bootloader.file))
endif
# processor stuff # processor stuff
ifndef MCU ifndef MCU
MCU = $(call PARSE_BOARD,$(BOARD_TAG),build.mcu) MCU := $(call PARSE_BOARD,$(BOARD_TAG),build.mcu)
ifndef MCU
# might be a submenu
MCU := $(call PARSE_BOARD,$(BOARD_TAG),menu.cpu.$(BOARD_SUB).build.mcu)
endif
endif endif
ifndef F_CPU ifndef F_CPU
F_CPU = $(call PARSE_BOARD,$(BOARD_TAG),build.f_cpu) F_CPU := $(call PARSE_BOARD,$(BOARD_TAG),build.f_cpu)
ifndef F_CPU
# might be a submenu
F_CPU := $(call PARSE_BOARD,$(BOARD_TAG),menu.cpu.$(BOARD_SUB).build.f_cpu)
endif
endif endif
ifneq ($(CATERINA),) ifneq ($(CATERINA),)
@ -557,11 +602,19 @@ ifeq ($(strip $(NO_CORE)),)
# normal programming info # normal programming info
ifndef AVRDUDE_ARD_PROGRAMMER ifndef AVRDUDE_ARD_PROGRAMMER
AVRDUDE_ARD_PROGRAMMER = $(call PARSE_BOARD,$(BOARD_TAG),upload.protocol) AVRDUDE_ARD_PROGRAMMER := $(call PARSE_BOARD,$(BOARD_TAG),upload.protocol)
ifndef AVRDUDE_ARD_PROGRAMMER
# might be a submenu
AVRDUDE_ARD_PROGRAMMER := $(call PARSE_BOARD,$(BOARD_TAG),menu.cpu.$(BOARD_SUB).upload.protocol)
endif
endif endif
ifndef AVRDUDE_ARD_BAUDRATE ifndef AVRDUDE_ARD_BAUDRATE
AVRDUDE_ARD_BAUDRATE = $(call PARSE_BOARD,$(BOARD_TAG),upload.speed) AVRDUDE_ARD_BAUDRATE := $(call PARSE_BOARD,$(BOARD_TAG),upload.speed)
ifndef AVRDUDE_ARD_BAUDRATE
# might be a submenu
AVRDUDE_ARD_BAUDRATE := $(call PARSE_BOARD,$(BOARD_TAG),menu.cpu.$(BOARD_SUB).upload.speed)
endif
endif endif
# fuses if you're using e.g. ISP # fuses if you're using e.g. ISP
@ -570,15 +623,27 @@ ifeq ($(strip $(NO_CORE)),)
endif endif
ifndef ISP_HIGH_FUSE ifndef ISP_HIGH_FUSE
ISP_HIGH_FUSE = $(call PARSE_BOARD,$(BOARD_TAG),bootloader.high_fuses) ISP_HIGH_FUSE := $(call PARSE_BOARD,$(BOARD_TAG),bootloader.high_fuses)
ifndef ISP_HIGH_FUSE
# might be a submenu
ISP_HIGH_FUSE := $(call PARSE_BOARD,$(BOARD_TAG),menu.cpu.$(BOARD_SUB).bootloader.high_fuses)
endif
endif endif
ifndef ISP_LOW_FUSE ifndef ISP_LOW_FUSE
ISP_LOW_FUSE = $(call PARSE_BOARD,$(BOARD_TAG),bootloader.low_fuses) ISP_LOW_FUSE := $(call PARSE_BOARD,$(BOARD_TAG),bootloader.low_fuses)
ifndef ISP_LOW_FUSE
# might be a submenu
ISP_LOW_FUSE := $(call PARSE_BOARD,$(BOARD_TAG),menu.cpu.$(BOARD_SUB).bootloader.low_fuses)
endif
endif endif
ifndef ISP_EXT_FUSE ifndef ISP_EXT_FUSE
ISP_EXT_FUSE = $(call PARSE_BOARD,$(BOARD_TAG),bootloader.extended_fuses) ISP_EXT_FUSE := $(call PARSE_BOARD,$(BOARD_TAG),bootloader.extended_fuses)
ifndef ISP_EXT_FUSE
# might be a submenu
ISP_EXT_FUSE := $(call PARSE_BOARD,$(BOARD_TAG),menu.cpu.$(BOARD_SUB).bootloader.extended_fuses)
endif
endif endif
ifndef BOOTLOADER_PATH ifndef BOOTLOADER_PATH
@ -586,7 +651,11 @@ ifeq ($(strip $(NO_CORE)),)
endif endif
ifndef BOOTLOADER_FILE ifndef BOOTLOADER_FILE
BOOTLOADER_FILE = $(call PARSE_BOARD,$(BOARD_TAG),bootloader.file) BOOTLOADER_FILE := $(call PARSE_BOARD,$(BOARD_TAG),bootloader.file)
ifndef BOOTLOADER_FILE
# might be a submenu
BOOTLOADER_FILE := $(call PARSE_BOARD,$(BOARD_TAG),menu.cpu.$(BOARD_SUB).bootloader.file)
endif
endif endif
ifndef ISP_LOCK_FUSE_POST ifndef ISP_LOCK_FUSE_POST
@ -594,7 +663,11 @@ ifeq ($(strip $(NO_CORE)),)
endif endif
ifndef HEX_MAXIMUM_SIZE ifndef HEX_MAXIMUM_SIZE
HEX_MAXIMUM_SIZE = $(call PARSE_BOARD,$(BOARD_TAG),upload.maximum_size) HEX_MAXIMUM_SIZE := $(call PARSE_BOARD,$(BOARD_TAG),upload.maximum_size)
ifndef HEX_MAXIMUM_SIZE
# might be a submenu
HEX_MAXIMUM_SIZE := $(call PARSE_BOARD,$(BOARD_TAG),menu.cpu.$(BOARD_SUB).upload.maximum_size)
endif
endif endif
endif endif
@ -924,7 +997,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/arduino/bootloaders BOOTLOADER_PARENT = $(ARDUINO_DIR)/hardware/$(VENDOR)/$(ARCHITECTURE)/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])

View file

@ -95,6 +95,11 @@ On Windows (using cygwin), you might want to set:
MONITOR_PORT = com3 MONITOR_PORT = com3
BOARD_TAG = mega2560 BOARD_TAG = mega2560
On Arduino 1.5.x installs, you should set the architecture to either `avr` or `sam` and if using a submenu CPU, then also set that:
ARCHITECTURE = avr
BOARD_SUB = atmega168
It is recommended in Windows that you create a symbolic link to avoid problems with file naming conventions on Windows. For example, if your your Arduino directory is in: It is recommended in Windows that you create a symbolic link to avoid problems with file naming conventions on Windows. For example, if your your Arduino directory is in:
c:\Program Files (x86)\Arduino c:\Program Files (x86)\Arduino

View file

@ -129,6 +129,42 @@ ARDUINO_VERSION = 105
---- ----
### ARCHITECTURE
**Description:**
Architecture for Arduino 1.5
Defaults to unset for 1.0 or `avr` for 1.5
**Example:**
```Makefile
ARCHITECTURE = sam
```
**Requirement:** *Optional*
----
### VENDOR
**Description:**
Board vendor/maintainer.
Defaults to `arduino`
**Example:**
```Makefile
VENDOR = sparkfun
```
**Requirement:** *Optional*
----
### ARDUINO_SKETCHBOOK ### ARDUINO_SKETCHBOOK
**Description:** **Description:**
@ -220,6 +256,26 @@ BOARD_TAG = uno or mega2560
---- ----
### BOARD_SUB
**Description:**
1.5 submenu as listed in `boards.txt`
**Example:**
```Makefile
# diecimila.name=Arduino Duemilanove or Diecimila
BOARD_TAG=diecimila
# diecimila.menu.cpu.atmega168=ATmega168
BOARD_SUB=atmega168
```
**Requirement:** *Mandatory for 1.5 if using a submenu CPU*
----
### MONITOR_PORT ### MONITOR_PORT
**Description:** **Description:**
@ -1030,6 +1086,8 @@ Relative path to bootloader directory.
Usually can be auto-detected as a relative `bootloader.path` from `boards.txt` Usually can be auto-detected as a relative `bootloader.path` from `boards.txt`
Deprecated in 1.5, now part of bootloader.file
**Example:** **Example:**
```Makefile ```Makefile