diff options
author | Tim Wawrzynczak <twawrzynczak@chromium.org> | 2019-11-06 13:13:44 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-11-18 19:59:53 +0000 |
commit | 6ab29e142da126a22e8098f822653a004662f60e (patch) | |
tree | 6c2bce036bc402fc9cb385c3000b01dd93e31e38 | |
parent | 6737b9e9a771fa14c6d90dc9197f054b69a85c1b (diff) | |
download | vboot-6ab29e142da126a22e8098f822653a004662f60e.tar.gz |
Split TLCL functionality out into a new library
This patch splits out the TPM functionality into a separate library called
TLCL (TPM lightweight command library). This is to avoid linking in TLCL
code two times and causing duplicate references.
BUG=none
BRANCH=none
TEST=make clean && make runtests
Cq-Depend: chromium:1901882
Change-Id: I56e961c066b2df1d1e19f632b834b11625454f59
Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1900560
Reviewed-by: Julius Werner <jwerner@chromium.org>
-rw-r--r-- | Makefile | 27 |
1 files changed, 20 insertions, 7 deletions
@@ -290,7 +290,7 @@ export BUILD_RUN # Default target. .PHONY: all -all: $(if ${NO_BUILD_TOOLS},,fwlib fwlib2x fwlib20 fwlib21) \ +all: $(if ${NO_BUILD_TOOLS},,fwlib fwlib2x fwlib20 fwlib21 tlcl) \ $(if ${FIRMWARE_ARCH},,host_stuff) \ $(if ${COV},coverage) @@ -329,6 +329,9 @@ FWLIB20 = ${BUILD}/vboot_fw20.a # Vboot 2.1 (not yet ready - see firmware/README) FWLIB21 = ${BUILD}/vboot_fw21.a +# Separate TPM lightweight command library (TLCL) +TLCL = ${BUILD}/tlcl.a + # Additional firmware library sources needed by VbSelectAndLoadKernel() call FWLIB_SRCS = \ firmware/lib/cgptlib/cgptlib.c \ @@ -395,11 +398,10 @@ endif # Support real TPM unless BIOS sets MOCK_TPM ifeq (${MOCK_TPM},) FWLIB_SRCS += \ - firmware/lib/secdata_tpm.c \ - ${TLCL_SRCS} + firmware/lib/secdata_tpm.c else FWLIB_SRCS += \ - firmware/lib/mocked_secdata_tpm.c \ + firmware/lib/mocked_secdata_tpm.c firmware/lib/tpm_lite/mocked_tlcl.c endif @@ -429,7 +431,9 @@ FWLIB_OBJS = ${FWLIB_SRCS:%.c=${BUILD}/%.o} FWLIB2X_OBJS = ${FWLIB2X_SRCS:%.c=${BUILD}/%.o} FWLIB20_OBJS = ${FWLIB20_SRCS:%.c=${BUILD}/%.o} FWLIB21_OBJS = ${FWLIB21_SRCS:%.c=${BUILD}/%.o} -ALL_OBJS += ${FWLIB_OBJS} ${FWLIB2X_OBJS} ${FWLIB20_OBJS} ${FWLIB21_OBJS} +TLCL_OBJS = ${TLCL_SRCS:%.c=${BUILD}/%.o} +ALL_OBJS += ${FWLIB_OBJS} ${FWLIB2X_OBJS} ${FWLIB20_OBJS} ${FWLIB21_OBJS} \ + ${TLCL_OBJS} # Intermediate library for the vboot_reference utilities to link against. UTILLIB = ${BUILD}/libvboot_util.a @@ -839,7 +843,7 @@ install_for_test: install # TPM_BLOCKING_CONTINUESELFTEST is defined if TPM_ContinueSelfTest blocks until # the self test has completed. -${FWLIB_OBJS}: CFLAGS += -DTPM_BLOCKING_CONTINUESELFTEST +${TLCL_OBJS}: CFLAGS += -DTPM_BLOCKING_CONTINUESELFTEST # TPM_MANUAL_SELFTEST is defined if the self test must be started manually # (with a call to TPM_ContinueSelfTest) instead of starting automatically at @@ -896,6 +900,15 @@ ${FWLIB21}: ${FWLIB2X_OBJS} ${FWLIB21_OBJS} @${PRINTF} " AR $(subst ${BUILD}/,,$@)\n" ${Q}ar qc $@ $^ +.PHONY: tlcl +tlcl: ${TLCL} + +${TLCL}: ${TLCL_OBJS} + @${PRINTF} " RM $(subst ${BUILD}/,,$@)\n" + ${Q}rm -f $@ + @${PRINTF} " AR $(subst ${BUILD}/,,$@)\n" + ${Q}ar qc $@ $^ + # ---------------------------------------------------------------------------- # Host library(s) @@ -904,7 +917,7 @@ utillib: ${UTILLIB} # TODO: better way to make .a than duplicating this recipe each time? ${UTILLIB}: ${UTILLIB_OBJS} ${FWLIB_OBJS} ${FWLIB2X_OBJS} ${FWLIB20_OBJS} \ - ${FWLIB21_OBJS} + ${FWLIB21_OBJS} ${TLCL_OBJS} @${PRINTF} " RM $(subst ${BUILD}/,,$@)\n" ${Q}rm -f $@ @${PRINTF} " AR $(subst ${BUILD}/,,$@)\n" |