summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorEdward O'Callaghan <quasisec@google.com>2022-02-28 13:08:15 +1100
committerCommit Bot <commit-bot@chromium.org>2022-02-28 23:30:28 +0000
commit07a7bc69641129e937ab702b95e893d4a5ba45fd (patch)
tree0f26b5205e1f190a27a316b7b8d6622512369e1b /Makefile
parent14b8a681131e81523f6dd9ffd5125026c737daed (diff)
downloadvboot-07a7bc69641129e937ab702b95e893d4a5ba45fd.tar.gz
vboot_reference/Makefile: Fix building with USE_FLASHROM:=0
Unfortunately the USE_FLASHROM build flag broke during a refactor in commit f0af257a9b333b. This flag is needed for coreboot builds. Resolve by putting relevant files under guards. BUG=b:221234560,b:220833585 BRANCH=none TEST=`USE_FLASHROM={0,1} make` Signed-off-by: Edward O'Callaghan <quasisec@google.com> Change-Id: Ic10a3909bf070897cef7f1556deef57eba6c57f3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3493527 Tested-by: Edward O'Callaghan <quasisec@chromium.org> Auto-Submit: Edward O'Callaghan <quasisec@chromium.org> Reviewed-by: Martin Roth <martinroth@google.com> Commit-Queue: Martin Roth <martinroth@google.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile17
1 files changed, 10 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index e6c3bcac..6340fb29 100644
--- a/Makefile
+++ b/Makefile
@@ -433,11 +433,18 @@ FWLIB_OBJS = ${FWLIB_SRCS:%.c=${BUILD}/%.o}
TLCL_OBJS = ${TLCL_SRCS:%.c=${BUILD}/%.o}
ALL_OBJS += ${FWLIB_OBJS} ${TLCL_OBJS}
+# Maintain behaviour of default on.
+USE_FLASHROM ?= 1
+
+ifneq ($(filter-out 0,${USE_FLASHROM}),)
+$(info building with libflashrom support)
+FLASHROM_LIBS := $(shell ${PKG_CONFIG} --libs flashrom)
COMMONLIB_SRCS = \
- host/lib/fmap.c \
host/lib/flashrom.c \
host/lib/flashrom_drv.c \
host/lib/subprocess.c
+CFLAGS += -DUSE_FLASHROM
+endif
# Intermediate library for the vboot_reference utilities to link against.
UTILLIB = ${BUILD}/libvboot_util.a
@@ -458,6 +465,7 @@ UTILLIB_SRCS = \
host/lib/crypto.c \
host/lib/file_keys.c \
$(COMMONLIB_SRCS) \
+ host/lib/fmap.c \
host/lib/host_common.c \
host/lib/host_key2.c \
host/lib/host_keyblock.c \
@@ -516,6 +524,7 @@ HOSTLIB_SRCS = \
host/lib/crypto.c \
host/lib/extract_vmlinuz.c \
$(COMMONLIB_SRCS) \
+ host/lib/fmap.c \
host/lib/host_misc.c \
host/lib21/host_misc.c \
${TLCL_SRCS}
@@ -659,19 +668,13 @@ FUTIL_SRCS = \
futility/vb1_helper.c \
futility/vb2_helper.c
-# Maintain behaviour of default on.
-USE_FLASHROM ?= 1
-
ifneq ($(filter-out 0,${USE_FLASHROM}),)
-$(info building with libflashrom support)
-FLASHROM_LIBS := $(shell ${PKG_CONFIG} --libs flashrom)
FUTIL_SRCS += host/lib/flashrom_drv.c \
futility/flashrom_wp_drv.c \
futility/updater_archive.c \
futility/updater_quirks.c \
futility/updater_utils.c \
futility/updater.c
-CFLAGS += -DUSE_FLASHROM
endif
# List of commands built in futility.