summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@chromium.org>2014-07-10 15:49:52 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-07-17 06:50:33 +0000
commit0f6679e8582219b40e2ab5485992827a92c18bcd (patch)
tree8818652613e2f9724fc64bc57502512b914e1f83
parentd462101f06e1bf817295a6cdd2b82e7e87eaeef3 (diff)
downloadvboot-0f6679e8582219b40e2ab5485992827a92c18bcd.tar.gz
Slight tweak to Makefile
Replacing a few duplicated items with a single definition, removing a couple of unnecessary/redundant dependencies. BUG=chromium:224734 BRANCH=ToT TEST=make runtests Change-Id: I31e78ae1e3810865e26c9c4937eb44222cbfa9d6 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/207741
-rw-r--r--Makefile35
1 files changed, 7 insertions, 28 deletions
diff --git a/Makefile b/Makefile
index 18dc871b..2fc37ecf 100644
--- a/Makefile
+++ b/Makefile
@@ -232,7 +232,7 @@ INCLUDES += \
# If we're not building for a specific target, just stub out things like the
# TPM commands and various external functions that are provided by the BIOS.
ifeq (${FIRMWARE_ARCH},)
-INCLUDES += -Ifirmware/stub/include
+INCLUDES += -Ifirmware/stub/include -Ihost/include -Ihost/lib/include
else
INCLUDES += -Ifirmware/arch/${FIRMWARE_ARCH}/include
endif
@@ -787,10 +787,6 @@ ${FWLIB2}: ${FWLIB2_OBJS}
# Link tests for local utilities
${BUILD}/host/linktest/main: ${UTILLIB}
-${BUILD}/host/linktest/main: INCLUDES += \
- -Ihost/include \
- -Ihost/arch/${ARCH}/include \
- -Ihost/lib/include
${BUILD}/host/linktest/main: LIBS = ${UTILLIB}
ALL_OBJS += ${BUILD}/host/linktest/main.o
@@ -808,7 +804,6 @@ ${UTILLIB}: ${UTILLIB_OBJS} ${FWLIB_OBJS} $(if ${VBOOT2},${FWLIB2_OBJS})
# Link tests for external repos
${BUILD}/host/linktest/extern: ${HOSTLIB}
-${BUILD}/host/linktest/extern: INCLUDES += -Ihost/include
${BUILD}/host/linktest/extern: LIBS = ${HOSTLIB}
${BUILD}/host/linktest/extern: LDLIBS += -static
ALL_OBJS += ${BUILD}/host/linktest/extern.o
@@ -818,7 +813,6 @@ hostlib: ${HOSTLIB} \
${BUILD}/host/linktest/extern
# TODO: better way to make .a than duplicating this recipe each time?
-${HOSTLIB}: INCLUDES += -Ihost/include -Ihost/lib/include
${HOSTLIB}: ${HOSTLIB_OBJS}
@$(PRINTF) " RM $(subst ${BUILD}/,,$@)\n"
${Q}rm -f $@
@@ -831,7 +825,6 @@ ${HOSTLIB}: ${HOSTLIB_OBJS}
tinyhostlib: ${TINYHOSTLIB}
${Q}cp -f ${TINYHOSTLIB} ${HOSTLIB}
-${TINYHOSTLIB}: INCLUDES += -Ihost/include -Ihost/lib/include
${TINYHOSTLIB}: ${TINYHOSTLIB_OBJS}
@$(PRINTF) " RM $(subst ${BUILD}/,,$@)\n"
${Q}rm -f $@
@@ -844,8 +837,6 @@ ${TINYHOSTLIB}: ${TINYHOSTLIB_OBJS}
.PHONY: cgpt
cgpt: ${CGPT}
-${CGPT_OBJS}: INCLUDES += -Ihost/include
-
${CGPT}: LDFLAGS += -static
${CGPT}: LDLIBS += -luuid
@@ -863,10 +854,10 @@ cgpt_install: ${CGPT}
# Utilities
# These have their own headers too.
-${BUILD}/utility/%: INCLUDES += \
- -Ihost/include \
- -Ihost/lib/include \
- -Iutility/include
+${BUILD}/utility/%: INCLUDES += -Iutility/include
+
+${UTIL_BINS} ${UTIL_BINS_STATIC}: ${UTILLIB}
+${UTIL_BINS} ${UTIL_BINS_STATIC}: LIBS = ${UTILLIB}
# Utilities for auto-update toolkits must be statically linked.
${UTIL_BINS_STATIC}: LDFLAGS += -static
@@ -877,9 +868,6 @@ utils: ${UTIL_BINS} ${UTIL_SCRIPTS}
${Q}cp -f ${UTIL_SCRIPTS} ${BUILD}/utility
${Q}chmod a+rx $(patsubst %,${BUILD}/%,${UTIL_SCRIPTS})
-${UTIL_BINS} ${UTIL_BINS_STATIC}: ${UTILLIB}
-${UTIL_BINS} ${UTIL_BINS_STATIC}: LIBS = ${UTILLIB}
-
.PHONY: utils_install
utils_install: ${UTIL_BINS} ${UTIL_SCRIPTS}
@$(PRINTF) " INSTALL UTILS\n"
@@ -906,11 +894,11 @@ endif
.PHONY: futil
futil: ${FUTIL_STATIC_BIN} ${FUTIL_BIN}
-${FUTIL_STATIC_BIN}: ${FUTIL_LDS} ${FUTIL_STATIC_OBJS}
+${FUTIL_STATIC_BIN}: ${FUTIL_LDS} ${FUTIL_STATIC_OBJS} ${UTILLIB}
@$(PRINTF) " LD $(subst ${BUILD}/,,$@)\n"
${Q}${LD} -o $@ ${CFLAGS} ${LDFLAGS} -static $^ ${LDLIBS}
-${FUTIL_BIN}: ${FUTIL_LDS} ${FUTIL_OBJS}
+${FUTIL_BIN}: ${FUTIL_LDS} ${FUTIL_OBJS} ${UTILLIB}
@$(PRINTF) " LD $(subst ${BUILD}/,,$@)\n"
${Q}${LD} -o $@ ${CFLAGS} ${LDFLAGS} $^ ${LDLIBS}
@@ -922,14 +910,6 @@ futil_install: ${FUTIL_BIN}
${Q}for prog in ${FUTIL_OLD}; do \
ln -sf futility "${F_DIR}/$$prog"; done
-# TODO(wfrichar): This will need some refactoring (crbug.com/228932)
-${BUILD}/futility/% ${UTILLIB}: INCLUDES += \
- -Ihost/include \
- -Ihost/arch/${ARCH}/include \
- -Ihost/lib/include
-${FUTIL_STATIC_BIN} ${FUTIL_BIN}: ${UTILLIB}
-${FUTIL_STATIC_BIN} ${FUTIL_BIN}: LIBS = ${UTILLIB}
-
# ----------------------------------------------------------------------------
# Utility to generate TLCL structure definition header file.
@@ -1044,7 +1024,6 @@ ALL_OBJS += ${BUILD}/utility/image_types.o
# Allow multiple definitions, so tests can mock functions from other libraries
${BUILD}/tests/%: CFLAGS += -Xlinker --allow-multiple-definition
-${BUILD}/tests/%: INCLUDES += -Ihost/include -Ihost/lib/include
${BUILD}/tests/%: LDLIBS += -lrt -luuid
${BUILD}/tests/%: LIBS += ${TESTLIB}