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 <gabeblack@google.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/40011
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
Commit-Queue: Gabe Black <gabeblack@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
This commit is contained in:
Gabe Black
2012-12-20 00:26:59 -08:00
committed by Gerrit
parent 90f78d2261
commit 0aedbe1950
3 changed files with 27 additions and 18 deletions

View File

@@ -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

View File

@@ -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}

View File

@@ -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 $@ $^