summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabe Black <gabeblack@chromium.org>2012-12-20 00:26:59 -0800
committerGerrit <chrome-bot@google.com>2012-12-21 12:42:42 -0800
commit0aedbe1950225f8c8f3e535efa9575dc3a9c970d (patch)
tree2e43c9fcdf9a410d82e38b09b8918ddd599e5490
parent90f78d22612f6255b174f21b0016d29c3805c721 (diff)
downloadvboot-0aedbe1950225f8c8f3e535efa9575dc3a9c970d.tar.gz
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>
-rw-r--r--Makefile33
-rw-r--r--build.mk6
-rw-r--r--firmware/Makefile6
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 $@ $^