diff options
author | Hung-Te Lin <hungte@chromium.org> | 2017-09-15 13:36:41 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-09-15 10:50:29 -0700 |
commit | c8e3d27c814634c629b46dab0b708d3cf375c641 (patch) | |
tree | 775c0aca00613d733a054c6d70b31c5ba3c4eeae /Makefile | |
parent | 7fad48ef55490098bb4082c88d96f312977eac54 (diff) | |
download | vboot-c8e3d27c814634c629b46dab0b708d3cf375c641.tar.gz |
Makefile: Build utils for both dynamic and static version.
The auto update process (especially firmware updater) needs static vboot
utilitys but normal OS images, including recovery images, don't need
that. We should build both dynamic and static binaries at the same time
for images to choose what they need.
Currently only `crossystem` will build static version. And after this
change is merged:
(cd /build/reef/usr/bin; file crossystem*)
crossystem: ELF 64-bit LSB shared object
crossystem_s: ELF 64-bit LSB executable
(cd /build/reef/usr/bin; du -sh crossystem*)
40K crossystem
808K crossystem_s
BUG=chromium:764753,chromium:765499
TEST=emerge-reef vboot_reference
BRANCH=None
Change-Id: Ibd66c87bb44c5593767aeb710240e0165103f016
Reviewed-on: https://chromium-review.googlesource.com/668274
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -594,11 +594,12 @@ UTIL_SCRIPTS += \ utility/vbutil_what_keys endif -# These utilities should be linked statically. +# These utilities should also provide static linked version (*_s). UTIL_NAMES_STATIC = \ utility/crossystem -UTIL_NAMES = ${UTIL_NAMES_STATIC} \ +UTIL_NAMES = \ + ${UTIL_NAMES_STATIC} \ utility/dumpRSAPublicKey \ utility/tpmc @@ -623,9 +624,9 @@ LZMA_LIBS := $(shell ${PKG_CONFIG} --libs liblzma) YAML_LIBS := $(shell ${PKG_CONFIG} --libs yaml-0.1) endif -UTIL_BINS_STATIC := $(addprefix ${BUILD}/,${UTIL_NAMES_STATIC}) -UTIL_BINS = $(addprefix ${BUILD}/,${UTIL_NAMES}) -ALL_OBJS += $(addsuffix .o,${UTIL_BINS} ${UTIL_BINS_STATIC}) +UTIL_BINS_STATIC := $(addsuffix _s,$(addprefix ${BUILD}/,${UTIL_NAMES_STATIC})) +UTIL_BINS = $(addprefix ${BUILD}/,${UTIL_NAMES}) ${UTIL_BINS_STATIC} +ALL_OBJS += $(addsuffix .o,${UTIL_BINS}) # Scripts for signing stuff. @@ -1195,6 +1196,10 @@ ${TESTLIB}: ${TESTLIB_OBJS} # Generic build rules. LIBS and OBJS can be overridden to tweak the generic # rules for specific targets. +${BUILD}/%_s: ${BUILD}/%.o ${OBJS} ${LIBS} + @${PRINTF} " LD (static) $(subst ${BUILD}/,,$@)\n" + ${Q}${LD} -o $@ ${CFLAGS} ${LDFLAGS} $< ${OBJS} ${LIBS} ${LDLIBS} + ${BUILD}/%: ${BUILD}/%.o ${OBJS} ${LIBS} @${PRINTF} " LD $(subst ${BUILD}/,,$@)\n" ${Q}${LD} -o $@ ${CFLAGS} ${LDFLAGS} $< ${OBJS} ${LIBS} ${LDLIBS} |