OLD | NEW |
1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 FWTOP := $(shell pwd) | 5 FWTOP := $(shell pwd) |
6 LIBDIR = $(FWTOP)/lib | 6 LIBDIR = $(FWTOP)/lib |
7 STUBDIR = $(FWTOP)/stub | 7 STUBDIR = $(FWTOP)/stub |
8 TESTDIR = $(FWTOP)/linktest | 8 TESTDIR = $(FWTOP)/linktest |
9 BUILD_ROOT := ${BUILD}/$(shell basename ${FWTOP}) | 9 BUILD_ROOT := ${BUILD}/$(shell basename ${FWTOP}) |
10 LIBS = $(FWLIB) # Firmware library must be self-contained | 10 LIBS = $(FWLIB) # Firmware library must be self-contained |
11 | 11 |
12 # Disable rollback TPM when compiling locally, since otherwise | 12 # Disable rollback TPM when compiling locally, since otherwise |
13 # load_kernel_test attempts to talk to the TPM. | 13 # load_kernel_test attempts to talk to the TPM. |
14 ifeq ($(FIRMWARE_ARCH),) | 14 ifeq ($(FIRMWARE_ARCH),) |
15 CFLAGS += -DDISABLE_ROLLBACK_TPM | 15 CFLAGS += -DDISABLE_ROLLBACK_TPM |
16 endif | 16 endif |
17 | 17 |
| 18 # TPM-specific flags. These depend on the particular TPM we're targeting for. |
| 19 # They are needed here only for compiling parts of the firmware code into |
| 20 # user-level tests. |
| 21 |
| 22 # TPM_BLOCKING_CONTINUESELFTEST is defined if TPM_ContinueSelfTest blocks until |
| 23 # the self test has completed. |
| 24 |
| 25 CLAGS += -DTPM_BLOCKING_CONTINUESELFTEST |
| 26 |
| 27 # TPM_MANUAL_SELFTEST is defined if the self test must be started manually |
| 28 # (with a call to TPM_ContinueSelfTest) instead of starting automatically at |
| 29 # power on. |
| 30 # |
| 31 # We sincerely hope that TPM_BLOCKING_CONTINUESELFTEST and TPM_MANUAL_SELFTEST |
| 32 # are not both defined at the same time. (See comment in code.) |
| 33 |
| 34 # CLAGS += -DTPM_MANUAL_SELFTEST |
| 35 |
18 INCLUDES = \ | 36 INCLUDES = \ |
19 -I$(FWTOP)/include \ | 37 -I$(FWTOP)/include \ |
20 -I$(LIBDIR)/include \ | 38 -I$(LIBDIR)/include \ |
21 -I$(LIBDIR)/cgptlib/include \ | 39 -I$(LIBDIR)/cgptlib/include \ |
22 -I$(LIBDIR)/cryptolib/include \ | 40 -I$(LIBDIR)/cryptolib/include \ |
23 -I$(LIBDIR)/tpm_lite/include | 41 -I$(LIBDIR)/tpm_lite/include |
24 | 42 |
25 ifeq ($(FIRMWARE_ARCH),) | 43 ifeq ($(FIRMWARE_ARCH),) |
26 INCLUDES += -I$(STUBDIR)/include | 44 INCLUDES += -I$(STUBDIR)/include |
27 else | 45 else |
28 INCLUDES += -I$(FWDIR)/arch/$(FIRMWARE_ARCH)/include | 46 INCLUDES += -I$(FWDIR)/arch/$(FIRMWARE_ARCH)/include |
29 endif | 47 endif |
30 | 48 |
31 # find ./lib -iname '*.c' | sort | 49 # find ./lib -iname '*.c' | sort |
32 LIB_SRCS = \ | 50 LIB_SRCS = \ |
33 ./lib/cgptlib/cgptlib.c \ | 51 ./lib/cgptlib/cgptlib.c \ |
34 ./lib/cgptlib/cgptlib_internal.c \ | 52 ./lib/cgptlib/cgptlib_internal.c \ |
35 ./lib/cgptlib/crc32.c \ | 53 ./lib/cgptlib/crc32.c \ |
36 ./lib/cryptolib/padding.c \ | 54 ./lib/cryptolib/padding.c \ |
37 ./lib/cryptolib/rsa.c \ | 55 ./lib/cryptolib/rsa.c \ |
38 ./lib/cryptolib/rsa_utility.c \ | 56 ./lib/cryptolib/rsa_utility.c \ |
39 ./lib/cryptolib/sha1.c \ | 57 ./lib/cryptolib/sha1.c \ |
40 ./lib/cryptolib/sha2.c \ | 58 ./lib/cryptolib/sha2.c \ |
41 ./lib/cryptolib/sha_utility.c \ | 59 ./lib/cryptolib/sha_utility.c \ |
42 ./lib/rollback_index.c \ | 60 ./lib/rollback_index.c \ |
| 61 ./lib/tpm_bootmode.c \ |
43 ./lib/stateful_util.c \ | 62 ./lib/stateful_util.c \ |
44 ./lib/tpm_lite/tlcl.c \ | 63 ./lib/tpm_lite/tlcl.c \ |
45 ./lib/utility.c \ | 64 ./lib/utility.c \ |
46 ./lib/vboot_common.c \ | 65 ./lib/vboot_common.c \ |
47 ./lib/vboot_firmware.c \ | 66 ./lib/vboot_firmware.c \ |
48 ./lib/vboot_kernel.c \ | 67 ./lib/vboot_kernel.c \ |
49 ./lib/vboot_nvstorage.c | 68 ./lib/vboot_nvstorage.c |
50 | 69 |
51 LIB_OBJS = $(LIB_SRCS:%.c=${BUILD_ROOT}/%.o) | 70 LIB_OBJS = $(LIB_SRCS:%.c=${BUILD_ROOT}/%.o) |
52 | 71 |
(...skipping 13 matching lines...) Expand all Loading... |
66 $(TESTDIR)/main.c $(STUB_OBJS) $(LIBS) | 85 $(TESTDIR)/main.c $(STUB_OBJS) $(LIBS) |
67 else | 86 else |
68 test : $(FWLIB) | 87 test : $(FWLIB) |
69 endif | 88 endif |
70 | 89 |
71 include ../common.mk | 90 include ../common.mk |
72 | 91 |
73 $(FWLIB) : $(LIB_OBJS) | 92 $(FWLIB) : $(LIB_OBJS) |
74 rm -f $@ | 93 rm -f $@ |
75 ar qc $@ $^ | 94 ar qc $@ $^ |
OLD | NEW |