Makefile: Suppress unwanted 'echo' output

Add a 'echo' command which can be called to generate output. If V=0 then
it is suppressed. This drops the unwanted output when V=0.

Signed-off-by: Simon Glass <sjg@chromium.org>
BUG=chromium:680243
BRANCH=none
TEST=V=0 emerge-reef chromeos-ec; See that the BUILD lines are gone

Change-Id: Ie4474024c84345d427f4d95a9ff194dc740f860f
Reviewed-on: https://chromium-review.googlesource.com/427364
Commit-Ready: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
This commit is contained in:
Simon Glass
2017-01-11 17:24:14 -07:00
committed by chrome-bot
parent 7d40fb380d
commit 70ea50153f

View File

@@ -33,10 +33,12 @@ _dir_y_create := $(foreach d,$(dirs-y),$(shell [ -d $(out)/$(BLD)/$(d) ] || \
# (warnings/errors only). Use echo thus: $(call echo,"stuff to echo")
ifeq ($(V),0)
Q := @
echo = echo -n;
quiet = echo -n; $(cmd_$(1))
silent = 1>/dev/null
silent_err = 2>/dev/null
else
echo = echo $(1);
ifeq ($(V),)
Q := @
quiet = @echo ' $(2)' $(subst $(out)/,,$@) ; $(cmd_$(1))
@@ -176,7 +178,7 @@ test-targets=$(foreach t,$(test-list-y),test-$(t))
ifeq "$(CONFIG_COMMON_RUNTIME)" "y"
$(test-targets): test-%:
@set -e ; \
echo " BUILD $(out)/$*" ; \
$(call echo," BUILD $(out)/$*") \
$(MAKE) --no-print-directory BOARD=$(BOARD) PROJECT=$* \
V=$(V) out=$(out)/$* TEST_BUILD=y; \
cp $(out)/$*/$*.bin $(out)/test-$*.bin
@@ -192,7 +194,7 @@ run-test-targets=$(foreach t,$(test-list-host),run-$(t))
$(host-test-targets): host-%:
@set -e ; \
echo " BUILD host - build/host/$*" ; \
$(call echo," BUILD host - build/host/$*") \
$(MAKE) --no-print-directory BOARD=host PROJECT=$* \
V=$(V) out=build/host/$* TEST_BUILD=y EMU_BUILD=y $(TEST_FLAG) \
CROSS_COMPILE= build/host/$*/$*.exe