diff options
| author | Pieter du Preez <pdupreez@gmail.com> | 2018-09-14 16:14:14 +0200 |
|---|---|---|
| committer | Pieter du Preez <pdupreez@gmail.com> | 2018-09-14 16:14:14 +0200 |
| commit | e44540043edb15c0ab7eab2a8d0cb3241933ce8e (patch) | |
| tree | a7d8c232034d5fb4a2a74116d11ac360bca0c9dd /arduino-mk-vars.md | |
| parent | 2442dafb4fa8a7f0c5212a0d0f6e3fbafb986b29 (diff) | |
Added the TOOL_PREFIX variable for setting up the executable tools.
Currently three different tool chains seem to be used:
* avr-*
* pic32-*
* arm-none-eabi-*
These all get set up independently. This patch centralizes the
definitions of the executable tools and does it generically, by means
of the newly introduced TOOL_PREFIX variable. Setting up a
tool chain is now simply a matter of defining the TOOL_PREFIX
variable. For the currently supported tool chains it gets set to avr,
pic32 or arm-none-eabi. Arbitrary tool chains can now easily be set up,
by the TOOL_PREFIX variable.
Although the use of the OVERRIDE_EXECUTABLES variable is now almost
not justifiable, it was left as-is, in order to assure backwards
compatibility.
Diffstat (limited to 'arduino-mk-vars.md')
| -rw-r--r-- | arduino-mk-vars.md | 48 |
1 files changed, 46 insertions, 2 deletions
diff --git a/arduino-mk-vars.md b/arduino-mk-vars.md index 2bc2205..b6b9b37 100644 --- a/arduino-mk-vars.md +++ b/arduino-mk-vars.md @@ -810,6 +810,37 @@ CC_NAME = pic32-gcc ---- +## Compiler/Executable variables + +### TOOL_PREFIX + +**Description:** + +The tool prefix, which gets prepended to the tools like $(TOOL_PREFIX)-gcc, $(TOOL_PREFIX)-g++, etc. +The following tools will be prefixed with '$(TOOL_PREFIX)-': + + * gcc + * g++ + * as + * objcopy + * objdump + * ar + * size + * nm + +Defaults to `avr` + +**Example:** + +```Makefile +TOOL_PREFIX = arm-none-eabi +TOOL_PREFIX = pic32 +``` + +**Requirement:** *Optional* + +---- + ### CXX_NAME **Description:** @@ -1146,14 +1177,27 @@ CPPFLAGS += -DMY_DEFINE_FOR_ALL_SOURCE_TYPES **Description:** -Override the default build tools. +Override the default build tool paths and names. -If set to `1`, each tool (`CC`, `CXX`, `AS`, `OBJCOPY`, `OBJDUMP`, `AR`, `SIZE`, `NM`) must have its path explicitly defined. See `chipKIT.mk`. +If OVERRIDE_EXECUTABLES is defined, all tools (`CC`, `CXX`, `AS`, +`OBJCOPY`, `OBJDUMP`, `AR`, `SIZE`, `NM`) must have their paths +explicitly defined. This may be used in the rare case where +overriding a path and/or executable name is required. +The "?=" assignment cannot be used because the executable tags +are already implicitly defined by Make (e.g. $(CC) == cc). **Example:** ```Makefile OVERRIDE_EXECUTABLES = 1 +CC = /usr/bin/avr-gcc +CXX = /usr/bin/avr-g++ +AS = /usr/bin/avr-as +OBJCOPY = /usr/bin/avr-objcopy +OBJDUMP = /usr/bin/avr-objdump +AR = /usr/bin/avr-ar +SIZE = /some_path/alternative_avr-size +NM = /some_path/alternative_avr-nm ``` **Requirement:** *Optional* |
