From 0aedbe1950225f8c8f3e535efa9575dc3a9c970d Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Thu, 20 Dec 2012 00:26:59 -0800 Subject: Add support for a V option which selects verbose Makefile output. When V=1, the full command lines are printed. When V is not 1, then only a small summary line is printed which shows what commands are being executed. The command lines themselves are usually quite long and are overwhelming to see fly by on the console. Abbreviated command lines are easier to read and don't fill up your console so quickly. This change is primarily targeted at vboot_fw.a and probably excludes some things which could also be converted. The indentation between the action string (OBJCOPY, CC, etc.) and the target is three spaces longer than "normal", aka what's used in depthcharge, so that when this make is run from the other, you can tell the difference between the commands run by each. BUG=chrome-os-partner:8339 TEST=Built with and without V=1 and saw and did not see the full command lines, respectively. BRANCH=None Change-Id: Ibee244c24dc44b8da109b8c23ac7273174836bb9 Signed-off-by: Gabe Black Reviewed-on: https://gerrit.chromium.org/gerrit/40011 Reviewed-by: Randall Spangler Reviewed-by: Che-Liang Chiou Commit-Queue: Gabe Black Tested-by: Gabe Black --- Makefile | 33 +++++++++++++++++++-------------- build.mk | 6 ++++-- firmware/Makefile | 6 ++++-- 3 files changed, 27 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index 9bca70e1..0c7b0b88 100644 --- a/Makefile +++ b/Makefile @@ -2,8 +2,13 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +ifneq ($(V),1) +Q := @ +endif + export FIRMWARE_ARCH export MOCK_TPM +export Q # This Makefile normally builds in a 'build' subdir, but use # @@ -97,7 +102,7 @@ SUBDIRS = firmware endif all: - set -e; \ + $(Q)set -e; \ for d in $(shell find ${SUBDIRS} -name '*.c' -exec dirname {} \; |\ sort -u); do \ newdir=${BUILD}/$$d; \ @@ -111,32 +116,32 @@ all: done libcgpt_cc: - mkdir -p ${BUILD}/cgpt ${BUILD}/firmware/lib/cgptlib ${BUILD}/firmware/stub - $(MAKE) -C cgpt libcgpt_cc + $(Q)mkdir -p ${BUILD}/cgpt ${BUILD}/firmware/lib/cgptlib ${BUILD}/firmware/stub + $(Q)$(MAKE) -C cgpt libcgpt_cc cgptmanager_tests: libcgpt_cc - mkdir -p ${BUILD}/tests - $(MAKE) -C tests cgptmanager_tests + $(Q)mkdir -p ${BUILD}/tests + $(Q)$(MAKE) -C tests cgptmanager_tests libdump_kernel_config: - mkdir -p ${BUILD}/utility - $(MAKE) -C utility $(DUMPKERNELCONFIGLIB) + $(Q)mkdir -p ${BUILD}/utility + $(Q)$(MAKE) -C utility $(DUMPKERNELCONFIGLIB) clean: - /bin/rm -rf ${BUILD} + $(Q)/bin/rm -rf ${BUILD} install: - $(MAKE) -C utility install - $(MAKE) -C cgpt install + $(Q)$(MAKE) -C utility install + $(Q)$(MAKE) -C cgpt install runtests: - $(MAKE) -C tests runtests + $(Q)$(MAKE) -C tests runtests runcgptmanagertests: - $(MAKE) -C tests runcgptmanagertests + $(Q)$(MAKE) -C tests runcgptmanagertests rbtest: - $(MAKE) -C tests rbtest + $(Q)$(MAKE) -C tests rbtest runbmptests: - $(MAKE) -C tests runbmptests + $(Q)$(MAKE) -C tests runbmptests diff --git a/build.mk b/build.mk index 177605e5..4b10a121 100644 --- a/build.mk +++ b/build.mk @@ -15,9 +15,11 @@ ALL_DEPS = $(ALL_OBJS:%.o=%.o.d) all: ${ALL_OBJS} ${BUILD_ROOT}/%.o : %.c - $(CC) $(CFLAGS) $(INCLUDES) -MMD -MF $@.d -c -o $@ $< + @printf " CC $(subst $(BUILD_ROOT)/,,$(@))\n" + $(Q)$(CC) $(CFLAGS) $(INCLUDES) -MMD -MF $@.d -c -o $@ $< ${BUILD_ROOT}/%.o : %.cc - $(CXX) $(CFLAGS) $(INCLUDES) -MMD -MF $@.d -c -o $@ $< + @printf " CXX $(subst $(BUILD_ROOT)/,,$(@))\n" + $(Q)$(CXX) $(CFLAGS) $(INCLUDES) -MMD -MF $@.d -c -o $@ $< -include ${ALL_DEPS} diff --git a/firmware/Makefile b/firmware/Makefile index 8d8e2ee2..1612da95 100644 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -129,5 +129,7 @@ endif include ../build.mk $(FWLIB) : $(LIB_OBJS) - rm -f $@ - ar qc $@ $^ + @printf " RM $(@))\n" + $(Q)rm -f $@ + @printf " AR $(@))\n" + $(Q)ar qc $@ $^ -- cgit v1.2.1