aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSudar Muthu <sudar@sudarmuthu.com>2018-03-18 22:36:23 +0530
committerGitHub <noreply@github.com>2018-03-18 22:36:23 +0530
commit0809b5460617f2217d8b4b0f9a57758e220c429c (patch)
treedca8317adc611502c59ce5028374c8dd83f15db2
parenta7b8084ac6b9b4d94dd91b9b996243432a7de4b3 (diff)
parent36b6b233eb161f2e086737116710e7667ad237a1 (diff)
Merge pull request #556 from wingunder/master
Added the DIAGNOSTICS_COLOR_WHEN var for controlling diagnostics-color.
-rw-r--r--Arduino.mk5
-rw-r--r--HISTORY.md1
-rw-r--r--arduino-mk-vars.md26
3 files changed, 29 insertions, 3 deletions
diff --git a/Arduino.mk b/Arduino.mk
index a238fe6..8ef79c7 100644
--- a/Arduino.mk
+++ b/Arduino.mk
@@ -1108,10 +1108,11 @@ endif
CFLAGS += $(CFLAGS_STD)
CXXFLAGS += -fpermissive -fno-exceptions $(CXXFLAGS_STD)
ASFLAGS += -x assembler-with-cpp
+DIAGNOSTICS_COLOR_WHEN ?= always
ifeq ($(shell expr $(CC_VERNUM) '>' 490), 1)
ASFLAGS += -flto
- CXXFLAGS += -fno-threadsafe-statics -flto -fno-devirtualize -fdiagnostics-color
- CFLAGS += -flto -fno-fat-lto-objects -fdiagnostics-color
+ CXXFLAGS += -fno-threadsafe-statics -flto -fno-devirtualize -fdiagnostics-color=$(DIAGNOSTICS_COLOR_WHEN)
+ CFLAGS += -flto -fno-fat-lto-objects -fdiagnostics-color=$(DIAGNOSTICS_COLOR_WHEN)
endif
LDFLAGS += -$(MCU_FLAG_NAME)=$(MCU) -Wl,--gc-sections -O$(OPTIMIZATION_LEVEL)
ifeq ($(shell expr $(CC_VERNUM) '>' 490), 1)
diff --git a/HISTORY.md b/HISTORY.md
index 434ed96..12155b4 100644
--- a/HISTORY.md
+++ b/HISTORY.md
@@ -15,6 +15,7 @@ I tried to give credit whenever possible. If I have missed anyone, kindly add it
- Tweak: Update Windows usage documentation and allow non-relative paths (issue #519) (https://github.com/tuna-f1sh)
- Tweak: Support Cygwin Unix Python and Windows installation on Windows to pass correct port binding. (https://github.com/tuna-f1sh)
- New: Added -fdiagnostics-color to \*STD flags (https://github.com/sej7278)
+- New: Made -fdiagnostics-color take a variiable DIAGNOSTICS_COLOR_WHEN: never, always, auto. (https://github.com/wingunder)
- New: Add generation of tags file using ctags, which automatically includes project libs and Arduino core. (https://github.com/tuna-f1sh)
- New: Add template Makefile and project boilerplate initialise script, `ardmk-init`. (https://github.com/tuna-f1sh)
- New: Support atmelice_isp JTAG tool as ISP programmer. (https://github.com/tuna-f1sh)
diff --git a/arduino-mk-vars.md b/arduino-mk-vars.md
index e3b6f07..2bc2205 100644
--- a/arduino-mk-vars.md
+++ b/arduino-mk-vars.md
@@ -1047,7 +1047,7 @@ CXXFLAGS_STD = -std=gnu++98
Flags passed to compiler for files compiled as C. Add more flags to this
variable using `+=`.
-Defaults to `undefined` on 1.0 or `-flto -fno-fat-lto-objects -fdiagnostics-color` on AVR toolchain > 4.9.0 (e.g. IDE 1.6.10+)
+Defaults to `undefined` on 1.0 or `-flto -fno-fat-lto-objects -fdiagnostics-color=$(DIAGNOSTICS_COLOR_WHEN)` on AVR toolchain > 4.9.0 (e.g. IDE 1.6.10+)
**Example:**
@@ -1080,6 +1080,30 @@ CXXFLAGS += -my-c++-onlyflag
----
+### DIAGNOSTICS_COLOR_WHEN
+
+**Description:**
+
+This variable controls the compiler's diagnostics-color setting, as defined
+in CFLAGS or CXXFLAGS, on AVR toolchain > 4.9.0.
+Supported values are: `always`, `never` and `auto`.
+For more details, see: [Options to Control Diagnostic Messages Formatting]
+(https://gcc.gnu.org/onlinedocs/gcc-4.9.2/gcc/Language-Independent-Options.html#Language-Independent-Options)
+
+Defaults to `always`.
+
+**Example:**
+
+```Makefile
+DIAGNOSTICS_COLOR_WHEN = never
+# or
+DIAGNOSTICS_COLOR_WHEN = auto
+```
+
+**Requirement:** *Optional*
+
+----
+
### ASFLAGS
**Description:**