summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Hesling <hesling@chromium.org>2020-12-17 17:05:51 -0800
committerCommit Bot <commit-bot@chromium.org>2020-12-21 16:49:32 +0000
commitbb25469f290398d7816df35345834b69777db925 (patch)
tree108fff3176f03673c3423135c549c2f21f5ea23d
parente2882f20fa28810e735e1a8f0750674e7940eb2d (diff)
downloadchrome-ec-bb25469f290398d7816df35345834b69777db925.tar.gz
make: Make V= flag parsing more clear
No functional change. The "else ifeq(x,y)" syntax is documented on the following page: www.gnu.org/software/make/manual/html_node/Conditional-Syntax.html The original change that brought in V=0: crrev.com/c/427363 BRANCH=none BUG=none TEST=# Run before and after change to confirm output is the same make hosttests V=0 make hosttests V= make hosttests V=1 make hosttests V=kabob Change-Id: I22021a794cc2e8dede845c0276a2cee67fa32550 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2597809 Tested-by: Craig Hesling <hesling@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Auto-Submit: Craig Hesling <hesling@chromium.org>
-rw-r--r--Makefile.rules10
1 files changed, 6 insertions, 4 deletions
diff --git a/Makefile.rules b/Makefile.rules
index fb06e6008d..f2a82a8bf1 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -34,25 +34,27 @@ _dir_create := $(foreach d,$(dirs) $(dirs-y),\
# Note: if cmd_* includes a $(MAKE) invocation, use the '+' prefix
# to inherit parallel make execution: "+$(call quiet,...)"
ifeq ($(V),0)
+# V=0
Q := @
echo = echo -n;
quiet = echo -n; $(cmd_$(1))
silent = 1>/dev/null
silent_err = 2>/dev/null
MAKEFLAGS += --no-print-directory
-else
-echo = echo $(1);
-ifeq ($(V),)
+else ifeq ($(V),)
+# V=
Q := @
+echo = echo $(1);
quiet = @echo ' $(2)' $(patsubst $(out)/%,%,$@) ; $(cmd_$(1))
silent = 1>/dev/null
silent_err = 2>/dev/null
MAKEFLAGS += --no-print-directory
else
+# V=*
Q :=
+echo = echo $(1);
quiet = $(cmd_$(1))
endif
-endif
# Provide an option to use a consistent ec_version.h file when
# compiling, which is useful to verify that a commit does not modify