summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2017-01-11 17:18:17 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-01-13 15:22:26 -0800
commit7d40fb380d1dd7a0720ef8f7e2f1bf052f826b4f (patch)
tree38667d29520da335936a3c557e9ff63f3ff78a11
parent70d4db19abefc169c7f5f087a80dca6f559527cf (diff)
downloadchrome-ec-7d40fb380d1dd7a0720ef8f7e2f1bf052f826b4f.tar.gz
Makefile: Support three levels of verbosity
At present the EC Makefile supports two levels of verbosity: V unset: Show an abbreviated build log (operation and file only) V=1: Show the full build log, including all commands However, even the abbreviated build log includes a lot of output. It is basically a long list of filenames and is of little use during development. It is more useful to show just warnings and errors. Add a new setting, V=0, which provides this. BUG=chromium:680243 BRANCH=none TEST=emerge-reef chromeos-ec; test each of V=, V=0, V=1 and see that the Makefile does the correct thing. Change-Id: I85c0423c5299fa3ab624ed9f7f7b6b7f73236611 Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/427363 Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r--Makefile.rules22
1 files changed, 18 insertions, 4 deletions
diff --git a/Makefile.rules b/Makefile.rules
index cc6ac278eb..a5e79f9f25 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -29,10 +29,24 @@ _dir_create := $(foreach d,$(dirs),$(shell [ -d $(out)/$(BLD)/$(d) ] || \
_dir_y_create := $(foreach d,$(dirs-y),$(shell [ -d $(out)/$(BLD)/$(d) ] || \
mkdir -p $(out)/RO/$(d); mkdir -p $(out)/RW/$(d)))
-# Decrease verbosity unless you pass V=1
-quiet = $(if $(V),,@echo ' $(2)' $(subst $(out)/,,$@) ; )$(cmd_$(1))
-silent = $(if $(V),,1>/dev/null)
-silent_err = $(if $(V),,2>/dev/null)
+# V unset for normal output, V=1 for verbose output, V=0 for silent build
+# (warnings/errors only). Use echo thus: $(call echo,"stuff to echo")
+ifeq ($(V),0)
+Q := @
+quiet = echo -n; $(cmd_$(1))
+silent = 1>/dev/null
+silent_err = 2>/dev/null
+else
+ifeq ($(V),)
+Q := @
+quiet = @echo ' $(2)' $(subst $(out)/,,$@) ; $(cmd_$(1))
+silent = 1>/dev/null
+silent_err = 2>/dev/null
+else
+Q :=
+quiet = $(cmd_$(1))
+endif
+endif
# commands to build all targets
cmd_lds = $(CPP) -P -C -MMD -MF $@.d -MT $@ $(CPPFLAGS) $< -o $@