diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 44 |
1 files changed, 39 insertions, 5 deletions
@@ -221,7 +221,8 @@ INCLUDES += \ -Ifirmware/lib/include \ -Ifirmware/lib/cgptlib/include \ -Ifirmware/lib/cryptolib/include \ - -Ifirmware/lib/tpm_lite/include + -Ifirmware/lib/tpm_lite/include \ + -Ifirmware/2lib/include # 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. @@ -234,6 +235,11 @@ endif # Firmware library. TODO: Do we still need to export this? FWLIB = ${BUILD}/vboot_fw.a +# Smaller firmware library. TODO: Do we still need to export this? +ifneq (${VBOOT2},) +FWLIB2 = ${BUILD}/vboot_fw2.a +endif + # Firmware library sources needed by VbInit() call VBINIT_SRCS = \ firmware/lib/crc8.c \ @@ -271,6 +277,10 @@ VBSLK_SRCS = \ firmware/lib/vboot_kernel.c \ firmware/lib/region-kernel.c \ +# Firmware library source needed for smaller library 2 +FWLIB2_SRCS = \ + firmware/2lib/2common.c \ + # Support real TPM unless BIOS sets MOCK_TPM ifeq (${MOCK_TPM},) VBINIT_SRCS += \ @@ -313,8 +323,11 @@ VBSF_OBJS = ${VBSF_SRCS:%.c=${BUILD}/%.o} FWLIB_OBJS = ${FWLIB_SRCS:%.c=${BUILD}/%.o} -ALL_OBJS += ${FWLIB_OBJS} ${VBINIT_OBJS} ${VBSF_OBJS} +ifneq (${VBOOT2},) +FWLIB2_OBJS = ${FWLIB2_SRCS:%.c=${BUILD}/%.o} +endif +ALL_OBJS += ${FWLIB_OBJS} ${FWLIB2_OBJS} ${VBINIT_OBJS} ${VBSF_OBJS} # Library to build the utilities. "HOST" mostly means "userspace". HOSTLIB = ${BUILD}/libvboot_host.a @@ -543,6 +556,12 @@ ifdef REGION_READ TEST_NAMES += tests/vboot_region_tests endif +ifneq (${VBOOT2},) +TEST_NAMES += \ + tests/vb2_common_tests \ + +endif + # TODO: port these tests to new API, if not already eqivalent # functionality in other tests. These don't even compile at present. # @@ -598,7 +617,8 @@ _dir_create := $(foreach d, \ # Default target. .PHONY: all -all: fwlib $(if ${FIRMWARE_ARCH},,host_stuff) $(if ${COV},coverage) +all: fwlib $(if ${VBOOT2},fwlib2) $(if ${FIRMWARE_ARCH},,host_stuff) \ + $(if ${COV},coverage) # Host targets .PHONY: host_stuff @@ -639,6 +659,7 @@ ${FWLIB_OBJS}: CFLAGS += -DTPM_BLOCKING_CONTINUESELFTEST ifeq (${FIRMWARE_ARCH},i386) # Unrolling loops in cryptolib makes it faster ${FWLIB_OBJS}: CFLAGS += -DUNROLL_LOOPS +${FWLIB2_OBJS}: CFLAGS += -DUNROLL_LOOPS # Workaround for coreboot on x86, which will power off asynchronously # without giving us a chance to react. This is not an example of the Right @@ -682,12 +703,21 @@ fwlinktest: ${FWLIB} \ .PHONY: fwlib fwlib: $(if ${FIRMWARE_ARCH},${FWLIB},fwlinktest) +.PHONY: fwlib2 +fwlib2: ${FWLIB2} + ${FWLIB}: ${FWLIB_OBJS} @$(PRINTF) " RM $(subst ${BUILD}/,,$@)\n" ${Q}rm -f $@ @$(PRINTF) " AR $(subst ${BUILD}/,,$@)\n" ${Q}ar qc $@ $^ +${FWLIB2}: ${FWLIB2_OBJS} + @$(PRINTF) " RM $(subst ${BUILD}/,,$@)\n" + ${Q}rm -f $@ + @$(PRINTF) " AR $(subst ${BUILD}/,,$@)\n" + ${Q}ar qc $@ $^ + # ---------------------------------------------------------------------------- # Host library @@ -706,7 +736,7 @@ ${BUILD}/host/% ${HOSTLIB}: INCLUDES += \ -Ihost/lib/include # TODO: better way to make .a than duplicating this recipe each time? -${HOSTLIB}: ${HOSTLIB_OBJS} ${FWLIB_OBJS} +${HOSTLIB}: ${HOSTLIB_OBJS} ${FWLIB_OBJS} $(if ${VBOOT2},${FWLIB2_OBJS}) @$(PRINTF) " RM $(subst ${BUILD}/,,$@)\n" ${Q}rm -f $@ @$(PRINTF) " AR $(subst ${BUILD}/,,$@)\n" @@ -957,7 +987,7 @@ ALL_OBJS += ${BUILD}/tests/tpm_lite/tlcl_tests.o # Frequently-run tests .PHONY: test_targets -test_targets:: runcgpttests runmisctests +test_targets:: runcgpttests runmisctests $(if ${VBOOT2},run2tests) ifeq (${MINIMAL},) # Bitmap utility isn't compiled for minimal variant @@ -1044,6 +1074,10 @@ runmisctests: test_setup ${RUNTEST} ${BUILD_RUN}/tests/vboot_kernel_tests ${RUNTEST} ${BUILD_RUN}/tests/vboot_nvstorage_test +.PHONY: run2tests +run2tests: test_setup + ${RUNTEST} ${BUILD_RUN}/tests/vb2_common_tests + .PHONY: runfutiltests runfutiltests: override DESTDIR = ${TEST_INSTALL_DIR} runfutiltests: test_setup install |