mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-05 22:41:44 +00:00
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>
This commit is contained in:
@@ -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 $@
|
||||
|
||||
Reference in New Issue
Block a user