Randall Spangler | e8cfa31 | 2013-01-02 16:49:38 -0800 | [diff] [blame] | 1 | # Copyright (c) 2013 The Chromium OS Authors. All rights reserved. |
Gaurav Shah | 322536d | 2010-01-28 15:01:23 -0800 | [diff] [blame] | 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
| 4 | |
Simon Glass | 6d696e5 | 2011-11-14 13:46:33 -0800 | [diff] [blame] | 5 | # This Makefile normally builds in a 'build' subdir, but use |
| 6 | # |
| 7 | # make BUILD=<dir> |
| 8 | # |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 9 | # to put the output somewhere else. |
| 10 | |
| 11 | ############################################################################## |
| 12 | # Make variables come in two flavors, immediate or deferred. |
| 13 | # |
| 14 | # Variable definitions are parsed like this: |
| 15 | # |
| 16 | # IMMEDIATE = DEFERRED |
| 17 | # or |
| 18 | # IMMEDIATE := IMMEDIATE |
| 19 | # |
| 20 | # Rules are parsed this way: |
| 21 | # |
| 22 | # IMMEDIATE : IMMEDIATE |
| 23 | # DEFERRED |
| 24 | # |
| 25 | # So you can assign variables in any order if they're only to be used in |
| 26 | # actions, but if you use a variable in either the target or prerequisite of a |
| 27 | # rule, the rule will be constructed using only the top-down, immediate value. |
| 28 | # |
| 29 | # So we'll try to define all the variables first. Then the rules. |
| 30 | # |
| 31 | |
| 32 | ############################################################################## |
| 33 | # Configuration variables come first. |
| 34 | # |
| 35 | # Our convention is that we only use := for variables that will never be |
| 36 | # changed or appended. They must be defined before being used anywhere. |
| 37 | |
Bill Richardson | c9bf348 | 2013-02-13 14:38:29 -0800 | [diff] [blame] | 38 | # We should only run pwd once, not every time we refer to ${BUILD}. |
Randall Spangler | e061a25 | 2013-01-22 15:34:07 -0800 | [diff] [blame] | 39 | SRCDIR := $(shell pwd) |
Bill Richardson | feb2518 | 2013-03-07 12:54:29 -0800 | [diff] [blame] | 40 | BUILD = $(SRCDIR)/build |
Randall Spangler | 844bce5 | 2013-01-15 16:16:43 -0800 | [diff] [blame] | 41 | export BUILD |
Simon Glass | 6d696e5 | 2011-11-14 13:46:33 -0800 | [diff] [blame] | 42 | |
Bill Richardson | c9bf348 | 2013-02-13 14:38:29 -0800 | [diff] [blame] | 43 | # Stuff for 'make install' |
Bill Richardson | feb2518 | 2013-03-07 12:54:29 -0800 | [diff] [blame] | 44 | INSTALL = install |
| 45 | DESTDIR = /usr/local/bin |
| 46 | OLDDIR = old_bins |
Bill Richardson | c9bf348 | 2013-02-13 14:38:29 -0800 | [diff] [blame] | 47 | |
Bill Richardson | feb2518 | 2013-03-07 12:54:29 -0800 | [diff] [blame] | 48 | # Where exactly do the pieces go? |
| 49 | # FT_DIR = futility target directory - where it will be on the target |
| 50 | # F_DIR = futility install directory - where it gets put right now |
| 51 | # UB_DIR = userspace binary directory for futility's exec() targets |
| 52 | # VB_DIR = target vboot directory - for dev-mode-only helpers, keys, etc. |
Bill Richardson | c9bf348 | 2013-02-13 14:38:29 -0800 | [diff] [blame] | 53 | ifeq (${MINIMAL},) |
| 54 | # Host install just puts everything in one place |
Bill Richardson | feb2518 | 2013-03-07 12:54:29 -0800 | [diff] [blame] | 55 | FT_DIR=${DESTDIR} |
| 56 | F_DIR=${DESTDIR} |
| 57 | UB_DIR=${DESTDIR}/${OLDDIR} |
Bill Richardson | c9bf348 | 2013-02-13 14:38:29 -0800 | [diff] [blame] | 58 | else |
| 59 | # Target install puts things into DESTDIR subdirectories |
Bill Richardson | feb2518 | 2013-03-07 12:54:29 -0800 | [diff] [blame] | 60 | FT_DIR=/usr/bin |
| 61 | F_DIR=${DESTDIR}${FT_DIR} |
| 62 | UB_DIR=${F_DIR}/${OLDDIR} |
Bill Richardson | c9bf348 | 2013-02-13 14:38:29 -0800 | [diff] [blame] | 63 | VB_DIR=${DESTDIR}/usr/share/vboot/bin |
| 64 | endif |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 65 | |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 66 | # Where to install the (exportable) executables for testing? |
| 67 | TEST_INSTALL_DIR = ${BUILD}/install_for_test |
| 68 | |
| 69 | # Verbose? Use V=1 |
| 70 | ifeq (${V},) |
| 71 | Q := @ |
| 72 | endif |
| 73 | |
Simon Glass | 661ae9e | 2013-03-26 11:39:21 -0700 | [diff] [blame] | 74 | # Quiet? Use QUIET=1 |
| 75 | ifeq ($(QUIET),) |
| 76 | PRINTF := printf |
| 77 | else |
| 78 | PRINTF := : |
| 79 | endif |
| 80 | |
Randall Spangler | 61a2eb3 | 2013-01-23 10:20:16 -0800 | [diff] [blame] | 81 | # Architecture detection |
| 82 | _machname := $(shell uname -m) |
| 83 | HOST_ARCH ?= ${_machname} |
| 84 | |
| 85 | # ARCH and/or FIRMWARE_ARCH are defined by the Chromium OS ebuild. |
| 86 | # Pick a sane target architecture if none is defined. |
| 87 | ifeq (${ARCH},) |
| 88 | ARCH := ${HOST_ARCH} |
| 89 | else ifeq (${ARCH},i386) |
| 90 | override ARCH := x86 |
| 91 | else ifeq (${ARCH},amd64) |
| 92 | override ARCH := x86_64 |
| 93 | endif |
| 94 | |
| 95 | # FIRMWARE_ARCH is only defined by the Chromium OS ebuild if compiling |
| 96 | # for a firmware target (such as u-boot or depthcharge). It must map |
| 97 | # to the same consistent set of architectures as the host. |
| 98 | ifeq (${FIRMWARE_ARCH},i386) |
| 99 | override FIRMWARE_ARCH := x86 |
| 100 | else ifeq (${FIRMWARE_ARCH},amd64) |
| 101 | override FIRMWARE_ARCH := x86_64 |
Stefan Reinauer | d96b25d | 2013-09-19 14:24:29 -0700 | [diff] [blame] | 102 | else ifeq (${FIRMWARE_ARCH},armv7) |
| 103 | override FIRMWARE_ARCH := arm |
Randall Spangler | 61a2eb3 | 2013-01-23 10:20:16 -0800 | [diff] [blame] | 104 | endif |
| 105 | |
Simon Glass | b265c34 | 2011-11-16 15:09:51 -0800 | [diff] [blame] | 106 | # Provide default CC and CFLAGS for firmware builds; if you have any -D flags, |
| 107 | # please add them after this point (e.g., -DVBOOT_DEBUG). |
Che-Liang Chiou | 74359b7 | 2011-06-21 15:25:51 -0700 | [diff] [blame] | 108 | # |
Che-Liang Chiou | 6b0003c | 2011-10-14 11:11:28 +0800 | [diff] [blame] | 109 | # TODO(crosbug.com/16808) We hard-code u-boot's compiler flags here just |
| 110 | # temporarily. As we are still investigating which flags are necessary for |
| 111 | # maintaining a compatible ABI, etc. between u-boot and vboot_reference. |
Che-Liang Chiou | 74359b7 | 2011-06-21 15:25:51 -0700 | [diff] [blame] | 112 | # |
Simon Glass | b265c34 | 2011-11-16 15:09:51 -0800 | [diff] [blame] | 113 | # As a first step, this makes the setting of CC and CFLAGS here optional, to |
| 114 | # permit a calling script or Makefile to set these. |
Che-Liang Chiou | 74359b7 | 2011-06-21 15:25:51 -0700 | [diff] [blame] | 115 | # |
Simon Glass | b265c34 | 2011-11-16 15:09:51 -0800 | [diff] [blame] | 116 | # Flag ordering: arch, then -f, then -m, then -W |
| 117 | DEBUG_FLAGS := $(if ${DEBUG},-g -O0,-Os) |
| 118 | COMMON_FLAGS := -nostdinc -pipe \ |
| 119 | -ffreestanding -fno-builtin -fno-stack-protector \ |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 120 | -Werror -Wall -Wstrict-prototypes ${DEBUG_FLAGS} |
Simon Glass | b265c34 | 2011-11-16 15:09:51 -0800 | [diff] [blame] | 121 | |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 122 | # Note: FIRMWARE_ARCH is defined by the Chromium OS ebuild. |
| 123 | ifeq (${FIRMWARE_ARCH}, arm) |
Simon Glass | b265c34 | 2011-11-16 15:09:51 -0800 | [diff] [blame] | 124 | CC ?= armv7a-cros-linux-gnueabi-gcc |
| 125 | CFLAGS ?= -march=armv5 \ |
| 126 | -fno-common -ffixed-r8 \ |
Doug Anderson | d50b27d | 2012-05-11 12:08:02 -0700 | [diff] [blame] | 127 | -mfloat-abi=hard -marm -mabi=aapcs-linux -mno-thumb-interwork \ |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 128 | ${COMMON_FLAGS} |
Randall Spangler | 61a2eb3 | 2013-01-23 10:20:16 -0800 | [diff] [blame] | 129 | else ifeq (${FIRMWARE_ARCH}, x86) |
Simon Glass | b265c34 | 2011-11-16 15:09:51 -0800 | [diff] [blame] | 130 | CC ?= i686-pc-linux-gnu-gcc |
| 131 | # Drop -march=i386 to permit use of SSE instructions |
| 132 | CFLAGS ?= \ |
| 133 | -ffunction-sections -fvisibility=hidden -fno-strict-aliasing \ |
| 134 | -fomit-frame-pointer -fno-toplevel-reorder -fno-dwarf2-cfi-asm \ |
Gabe Black | 46e00e6 | 2013-12-18 18:23:24 -0800 | [diff] [blame] | 135 | -mpreferred-stack-boundary=2 \ |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 136 | ${COMMON_FLAGS} |
| 137 | else ifeq (${FIRMWARE_ARCH}, x86_64) |
| 138 | CFLAGS ?= ${COMMON_FLAGS} \ |
Simon Glass | 8e85e98 | 2011-11-22 13:54:50 -0800 | [diff] [blame] | 139 | -fvisibility=hidden -fno-strict-aliasing -fomit-frame-pointer |
Randall Spangler | 844bce5 | 2013-01-15 16:16:43 -0800 | [diff] [blame] | 140 | else |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 141 | # FIRMWARE_ARCH not defined; assuming local compile. |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 142 | CC ?= gcc |
Bill Richardson | d462101 | 2014-07-09 23:31:13 -0700 | [diff] [blame^] | 143 | CFLAGS += -DCHROMEOS_ENVIRONMENT -Wall -Werror ${DEBUG_FLAGS} |
Che-Liang Chiou | 34be827 | 2011-01-27 16:44:36 +0800 | [diff] [blame] | 144 | endif |
| 145 | |
Bill Richardson | feb2518 | 2013-03-07 12:54:29 -0800 | [diff] [blame] | 146 | ifneq (${OLDDIR},) |
| 147 | CFLAGS += -DOLDDIR=${OLDDIR} |
| 148 | endif |
| 149 | |
Che-Liang Chiou | 34be827 | 2011-01-27 16:44:36 +0800 | [diff] [blame] | 150 | ifneq (${DEBUG},) |
| 151 | CFLAGS += -DVBOOT_DEBUG |
vbendeb | b2b0fcc | 2010-07-15 15:09:47 -0700 | [diff] [blame] | 152 | endif |
Che-Liang Chiou | 0a0e8d0 | 2010-11-30 09:30:45 +0800 | [diff] [blame] | 153 | |
vbendeb | b2b0fcc | 2010-07-15 15:09:47 -0700 | [diff] [blame] | 154 | ifeq (${DISABLE_NDEBUG},) |
| 155 | CFLAGS += -DNDEBUG |
| 156 | endif |
| 157 | |
Bill Richardson | feb2518 | 2013-03-07 12:54:29 -0800 | [diff] [blame] | 158 | ifneq (${FORCE_LOGGING_ON},) |
| 159 | CFLAGS += -DFORCE_LOGGING_ON=${FORCE_LOGGING_ON} |
| 160 | endif |
| 161 | |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 162 | # Create / use dependency files |
| 163 | CFLAGS += -MMD -MF $@.d |
Simon Glass | b265c34 | 2011-11-16 15:09:51 -0800 | [diff] [blame] | 164 | |
Bertrand SIMONNET | f8f807a | 2014-06-30 09:41:13 -0700 | [diff] [blame] | 165 | ifeq (${FIRMWARE_ARCH},) |
| 166 | # Creates position independent code for non firmware target. |
| 167 | CFLAGS += -fPIE |
| 168 | endif |
| 169 | |
Bill Richardson | 0c3ba24 | 2013-03-29 11:09:30 -0700 | [diff] [blame] | 170 | # These are required to access large disks and files on 32-bit systems. |
| 171 | CFLAGS += -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 |
| 172 | |
Randall Spangler | 59d7508 | 2013-01-23 09:29:54 -0800 | [diff] [blame] | 173 | # Code coverage |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 174 | ifneq (${COV},) |
Bill Richardson | d2d08b2 | 2014-07-08 16:31:40 -0700 | [diff] [blame] | 175 | COV_FLAGS = -O0 --coverage -DCOVERAGE |
Randall Spangler | 59d7508 | 2013-01-23 09:29:54 -0800 | [diff] [blame] | 176 | CFLAGS += ${COV_FLAGS} |
| 177 | LDFLAGS += ${COV_FLAGS} |
| 178 | COV_INFO = ${BUILD}/coverage.info |
Che-Liang Chiou | 0a0e8d0 | 2010-11-30 09:30:45 +0800 | [diff] [blame] | 179 | endif |
Gaurav Shah | 322536d | 2010-01-28 15:01:23 -0800 | [diff] [blame] | 180 | |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 181 | # And a few more default utilities |
| 182 | LD = ${CC} |
| 183 | CXX ?= g++ # HEY: really? |
| 184 | PKG_CONFIG ?= pkg-config |
| 185 | |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 186 | # Determine QEMU architecture needed, if any |
| 187 | ifeq (${ARCH},${HOST_ARCH}) |
| 188 | # Same architecture; no need for QEMU |
| 189 | QEMU_ARCH := |
Randall Spangler | 61a2eb3 | 2013-01-23 10:20:16 -0800 | [diff] [blame] | 190 | else ifeq (${HOST_ARCH}-${ARCH},x86_64-x86) |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 191 | # 64-bit host can run 32-bit targets directly |
| 192 | QEMU_ARCH := |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 193 | else |
| 194 | QEMU_ARCH := ${ARCH} |
| 195 | endif |
| 196 | |
| 197 | # The top of the chroot for qemu must be passed in via the SYSROOT environment |
| 198 | # variable. In the Chromium OS chroot, this is done automatically by the |
| 199 | # ebuild. |
| 200 | |
| 201 | ifeq (${QEMU_ARCH},) |
| 202 | # Path to build output for running tests is same as for building |
| 203 | BUILD_RUN = ${BUILD} |
Randall Spangler | e061a25 | 2013-01-22 15:34:07 -0800 | [diff] [blame] | 204 | SRC_RUN = ${SRCDIR} |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 205 | else |
| 206 | $(info Using qemu for testing.) |
| 207 | # Path to build output for running tests is different in the chroot |
| 208 | BUILD_RUN = $(subst ${SYSROOT},,${BUILD}) |
Randall Spangler | e061a25 | 2013-01-22 15:34:07 -0800 | [diff] [blame] | 209 | SRC_RUN = $(subst ${SYSROOT},,${SRCDIR}) |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 210 | |
| 211 | QEMU_BIN = qemu-${QEMU_ARCH} |
Randall Spangler | e061a25 | 2013-01-22 15:34:07 -0800 | [diff] [blame] | 212 | QEMU_RUN = ${BUILD_RUN}/${QEMU_BIN} |
| 213 | export QEMU_RUN |
| 214 | |
| 215 | RUNTEST = tests/test_using_qemu.sh |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 216 | endif |
| 217 | |
Randall Spangler | e061a25 | 2013-01-22 15:34:07 -0800 | [diff] [blame] | 218 | export BUILD_RUN |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 219 | |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 220 | ############################################################################## |
| 221 | # Now we need to describe everything we might want or need to build |
| 222 | |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 223 | # Everything wants these headers. |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 224 | INCLUDES += \ |
| 225 | -Ifirmware/include \ |
| 226 | -Ifirmware/lib/include \ |
| 227 | -Ifirmware/lib/cgptlib/include \ |
| 228 | -Ifirmware/lib/cryptolib/include \ |
Randall Spangler | 786acda | 2014-05-22 13:27:07 -0700 | [diff] [blame] | 229 | -Ifirmware/lib/tpm_lite/include \ |
| 230 | -Ifirmware/2lib/include |
Bill Richardson | 0b8f35c | 2010-05-26 09:18:38 -0700 | [diff] [blame] | 231 | |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 232 | # If we're not building for a specific target, just stub out things like the |
| 233 | # TPM commands and various external functions that are provided by the BIOS. |
| 234 | ifeq (${FIRMWARE_ARCH},) |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 235 | INCLUDES += -Ifirmware/stub/include |
Che-Liang Chiou | 0a0e8d0 | 2010-11-30 09:30:45 +0800 | [diff] [blame] | 236 | else |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 237 | INCLUDES += -Ifirmware/arch/${FIRMWARE_ARCH}/include |
Che-Liang Chiou | 0a0e8d0 | 2010-11-30 09:30:45 +0800 | [diff] [blame] | 238 | endif |
Gaurav Shah | 322536d | 2010-01-28 15:01:23 -0800 | [diff] [blame] | 239 | |
Bill Richardson | 7829902 | 2014-06-20 14:33:00 -0700 | [diff] [blame] | 240 | # Firmware library, used by the other firmware components (depthcharge, |
| 241 | # coreboot, etc.). It doesn't need exporting to some other place; they'll build |
| 242 | # this source tree locally and link to it directly. |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 243 | FWLIB = ${BUILD}/vboot_fw.a |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 244 | |
Randall Spangler | 786acda | 2014-05-22 13:27:07 -0700 | [diff] [blame] | 245 | # Smaller firmware library. TODO: Do we still need to export this? |
| 246 | ifneq (${VBOOT2},) |
| 247 | FWLIB2 = ${BUILD}/vboot_fw2.a |
| 248 | endif |
| 249 | |
Randall Spangler | 9394326 | 2013-02-26 11:03:57 -0800 | [diff] [blame] | 250 | # Firmware library sources needed by VbInit() call |
| 251 | VBINIT_SRCS = \ |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 252 | firmware/lib/crc8.c \ |
Randall Spangler | 9394326 | 2013-02-26 11:03:57 -0800 | [diff] [blame] | 253 | firmware/lib/utility.c \ |
| 254 | firmware/lib/vboot_api_init.c \ |
| 255 | firmware/lib/vboot_common_init.c \ |
| 256 | firmware/lib/vboot_nvstorage.c \ |
Bill Richardson | 7829902 | 2014-06-20 14:33:00 -0700 | [diff] [blame] | 257 | firmware/lib/vboot_nvstorage_rollback.c \ |
Simon Glass | 527ba81 | 2013-07-25 08:48:47 -0600 | [diff] [blame] | 258 | firmware/lib/region-init.c \ |
Randall Spangler | 9394326 | 2013-02-26 11:03:57 -0800 | [diff] [blame] | 259 | |
| 260 | # Additional firmware library sources needed by VbSelectFirmware() call |
| 261 | VBSF_SRCS = \ |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 262 | firmware/lib/cryptolib/padding.c \ |
| 263 | firmware/lib/cryptolib/rsa.c \ |
| 264 | firmware/lib/cryptolib/rsa_utility.c \ |
| 265 | firmware/lib/cryptolib/sha1.c \ |
| 266 | firmware/lib/cryptolib/sha256.c \ |
| 267 | firmware/lib/cryptolib/sha512.c \ |
| 268 | firmware/lib/cryptolib/sha_utility.c \ |
| 269 | firmware/lib/stateful_util.c \ |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 270 | firmware/lib/vboot_api_firmware.c \ |
Randall Spangler | 9394326 | 2013-02-26 11:03:57 -0800 | [diff] [blame] | 271 | firmware/lib/vboot_common.c \ |
Simon Glass | 527ba81 | 2013-07-25 08:48:47 -0600 | [diff] [blame] | 272 | firmware/lib/vboot_firmware.c \ |
| 273 | firmware/lib/region-fw.c \ |
Randall Spangler | 9394326 | 2013-02-26 11:03:57 -0800 | [diff] [blame] | 274 | |
| 275 | # Additional firmware library sources needed by VbSelectAndLoadKernel() call |
| 276 | VBSLK_SRCS = \ |
| 277 | firmware/lib/cgptlib/cgptlib.c \ |
| 278 | firmware/lib/cgptlib/cgptlib_internal.c \ |
| 279 | firmware/lib/cgptlib/crc32.c \ |
Albert Chaulk | 5c9e453 | 2013-03-20 16:03:49 -0700 | [diff] [blame] | 280 | firmware/lib/cgptlib/mtdlib.c \ |
Randall Spangler | 9394326 | 2013-02-26 11:03:57 -0800 | [diff] [blame] | 281 | firmware/lib/utility_string.c \ |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 282 | firmware/lib/vboot_api_kernel.c \ |
| 283 | firmware/lib/vboot_audio.c \ |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 284 | firmware/lib/vboot_display.c \ |
Simon Glass | 527ba81 | 2013-07-25 08:48:47 -0600 | [diff] [blame] | 285 | firmware/lib/vboot_kernel.c \ |
| 286 | firmware/lib/region-kernel.c \ |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 287 | |
Randall Spangler | 786acda | 2014-05-22 13:27:07 -0700 | [diff] [blame] | 288 | # Firmware library source needed for smaller library 2 |
| 289 | FWLIB2_SRCS = \ |
Randall Spangler | a7ab8b5 | 2014-06-10 17:05:08 -0700 | [diff] [blame] | 290 | firmware/2lib/2api.c \ |
Randall Spangler | 786acda | 2014-05-22 13:27:07 -0700 | [diff] [blame] | 291 | firmware/2lib/2common.c \ |
Randall Spangler | 3333e57 | 2014-05-14 11:37:52 -0700 | [diff] [blame] | 292 | firmware/2lib/2crc8.c \ |
| 293 | firmware/2lib/2misc.c \ |
| 294 | firmware/2lib/2nvstorage.c \ |
Randall Spangler | e166d04 | 2014-05-13 09:24:52 -0700 | [diff] [blame] | 295 | firmware/2lib/2rsa.c \ |
Randall Spangler | 3333e57 | 2014-05-14 11:37:52 -0700 | [diff] [blame] | 296 | firmware/2lib/2secdata.c \ |
Randall Spangler | e166d04 | 2014-05-13 09:24:52 -0700 | [diff] [blame] | 297 | firmware/2lib/2sha1.c \ |
| 298 | firmware/2lib/2sha256.c \ |
| 299 | firmware/2lib/2sha512.c \ |
| 300 | firmware/2lib/2sha_utility.c \ |
Randall Spangler | 786acda | 2014-05-22 13:27:07 -0700 | [diff] [blame] | 301 | |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 302 | # Support real TPM unless BIOS sets MOCK_TPM |
| 303 | ifeq (${MOCK_TPM},) |
Randall Spangler | 9394326 | 2013-02-26 11:03:57 -0800 | [diff] [blame] | 304 | VBINIT_SRCS += \ |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 305 | firmware/lib/rollback_index.c \ |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 306 | firmware/lib/tpm_lite/tlcl.c |
Randall Spangler | 9394326 | 2013-02-26 11:03:57 -0800 | [diff] [blame] | 307 | |
| 308 | VBSF_SRCS += \ |
| 309 | firmware/lib/tpm_bootmode.c |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 310 | else |
Randall Spangler | 9394326 | 2013-02-26 11:03:57 -0800 | [diff] [blame] | 311 | VBINIT_SRCS += \ |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 312 | firmware/lib/mocked_rollback_index.c \ |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 313 | firmware/lib/tpm_lite/mocked_tlcl.c |
Randall Spangler | 9394326 | 2013-02-26 11:03:57 -0800 | [diff] [blame] | 314 | |
| 315 | VBSF_SRCS += \ |
| 316 | firmware/lib/mocked_tpm_bootmode.c |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 317 | endif |
| 318 | |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 319 | ifeq (${FIRMWARE_ARCH},) |
| 320 | # Include BIOS stubs in the firmware library when compiling for host |
Randall Spangler | 9394326 | 2013-02-26 11:03:57 -0800 | [diff] [blame] | 321 | # TODO: split out other stub funcs too |
| 322 | VBINIT_SRCS += \ |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 323 | firmware/stub/tpm_lite_stub.c \ |
| 324 | firmware/stub/utility_stub.c \ |
Simon Glass | 527ba81 | 2013-07-25 08:48:47 -0600 | [diff] [blame] | 325 | firmware/stub/vboot_api_stub_init.c \ |
| 326 | firmware/stub/vboot_api_stub_region.c |
Randall Spangler | 9394326 | 2013-02-26 11:03:57 -0800 | [diff] [blame] | 327 | |
| 328 | VBSF_SRCS += \ |
| 329 | firmware/stub/vboot_api_stub_sf.c |
| 330 | |
| 331 | VBSLK_SRCS += \ |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 332 | firmware/stub/vboot_api_stub.c \ |
| 333 | firmware/stub/vboot_api_stub_disk.c |
Randall Spangler | da2b49c | 2014-06-10 17:03:40 -0700 | [diff] [blame] | 334 | |
| 335 | FWLIB2_SRCS += \ |
| 336 | firmware/2lib/2stub.c |
| 337 | |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 338 | endif |
| 339 | |
Randall Spangler | 9394326 | 2013-02-26 11:03:57 -0800 | [diff] [blame] | 340 | VBSF_SRCS += ${VBINIT_SRCS} |
| 341 | FWLIB_SRCS += ${VBSF_SRCS} ${VBSLK_SRCS} |
| 342 | |
| 343 | VBINIT_OBJS = ${VBINIT_SRCS:%.c=${BUILD}/%.o} |
| 344 | VBSF_OBJS = ${VBSF_SRCS:%.c=${BUILD}/%.o} |
| 345 | |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 346 | FWLIB_OBJS = ${FWLIB_SRCS:%.c=${BUILD}/%.o} |
Bill Richardson | 1912bba | 2013-04-04 21:08:50 -0700 | [diff] [blame] | 347 | |
Randall Spangler | 786acda | 2014-05-22 13:27:07 -0700 | [diff] [blame] | 348 | ifneq (${VBOOT2},) |
| 349 | FWLIB2_OBJS = ${FWLIB2_SRCS:%.c=${BUILD}/%.o} |
| 350 | endif |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 351 | |
Randall Spangler | 786acda | 2014-05-22 13:27:07 -0700 | [diff] [blame] | 352 | ALL_OBJS += ${FWLIB_OBJS} ${FWLIB2_OBJS} ${VBINIT_OBJS} ${VBSF_OBJS} |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 353 | |
Bill Richardson | 7829902 | 2014-06-20 14:33:00 -0700 | [diff] [blame] | 354 | # Intermediate library for the vboot_reference utilities to link against. |
| 355 | UTILLIB = ${BUILD}/libvboot_util.a |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 356 | |
Bill Richardson | 7829902 | 2014-06-20 14:33:00 -0700 | [diff] [blame] | 357 | UTILLIB_SRCS = \ |
Bill Richardson | 81a0b3d | 2013-02-28 13:53:09 -0800 | [diff] [blame] | 358 | cgpt/cgpt_create.c \ |
| 359 | cgpt/cgpt_add.c \ |
| 360 | cgpt/cgpt_boot.c \ |
| 361 | cgpt/cgpt_show.c \ |
| 362 | cgpt/cgpt_repair.c \ |
| 363 | cgpt/cgpt_prioritize.c \ |
| 364 | cgpt/cgpt_common.c \ |
Bill Richardson | 18e0370 | 2014-06-23 17:48:33 -0700 | [diff] [blame] | 365 | cgpt/flash_ts.c \ |
Albert Chaulk | 534723a | 2013-03-20 14:46:50 -0700 | [diff] [blame] | 366 | cgpt/flash_ts_drv.c \ |
Albert Chaulk | b334e65 | 2013-03-28 15:25:33 -0700 | [diff] [blame] | 367 | firmware/lib/cgptlib/mtdlib.c \ |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 368 | host/arch/${ARCH}/lib/crossystem_arch.c \ |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 369 | host/lib/crossystem.c \ |
| 370 | host/lib/file_keys.c \ |
| 371 | host/lib/fmap.c \ |
| 372 | host/lib/host_common.c \ |
| 373 | host/lib/host_key.c \ |
| 374 | host/lib/host_keyblock.c \ |
| 375 | host/lib/host_misc.c \ |
Bill Richardson | 7829902 | 2014-06-20 14:33:00 -0700 | [diff] [blame] | 376 | host/lib/util_misc.c \ |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 377 | host/lib/host_signature.c \ |
Bill Richardson | 81a0b3d | 2013-02-28 13:53:09 -0800 | [diff] [blame] | 378 | host/lib/signature_digest.c \ |
| 379 | utility/dump_kernel_config_lib.c |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 380 | |
Bill Richardson | 7829902 | 2014-06-20 14:33:00 -0700 | [diff] [blame] | 381 | UTILLIB_OBJS = ${UTILLIB_SRCS:%.c=${BUILD}/%.o} |
| 382 | ALL_OBJS += ${UTILLIB_OBJS} |
| 383 | |
| 384 | # Externally exported library for some target userspace apps to link with |
| 385 | # (cryptohome, updater, etc.) |
| 386 | HOSTLIB = ${BUILD}/libvboot_host.a |
| 387 | |
| 388 | HOSTLIB_SRCS = \ |
| 389 | cgpt/cgpt_add.c \ |
| 390 | cgpt/cgpt_boot.c \ |
| 391 | cgpt/cgpt_common.c \ |
| 392 | cgpt/cgpt_create.c \ |
| 393 | cgpt/cgpt_prioritize.c \ |
Bill Richardson | 18e0370 | 2014-06-23 17:48:33 -0700 | [diff] [blame] | 394 | cgpt/flash_ts.c \ |
Bill Richardson | 7829902 | 2014-06-20 14:33:00 -0700 | [diff] [blame] | 395 | cgpt/flash_ts_drv.c \ |
| 396 | firmware/lib/cgptlib/cgptlib_internal.c \ |
| 397 | firmware/lib/cgptlib/crc32.c \ |
| 398 | firmware/lib/cgptlib/mtdlib.c \ |
| 399 | firmware/lib/crc8.c \ |
Bill Richardson | 7829902 | 2014-06-20 14:33:00 -0700 | [diff] [blame] | 400 | firmware/lib/tpm_lite/tlcl.c \ |
| 401 | firmware/lib/utility_string.c \ |
| 402 | firmware/lib/vboot_nvstorage.c \ |
| 403 | firmware/stub/tpm_lite_stub.c \ |
| 404 | firmware/stub/utility_stub.c \ |
| 405 | firmware/stub/vboot_api_stub_init.c \ |
| 406 | host/arch/${ARCH}/lib/crossystem_arch.c \ |
| 407 | host/lib/crossystem.c \ |
| 408 | host/lib/host_misc.c \ |
| 409 | utility/dump_kernel_config_lib.c |
| 410 | |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 411 | HOSTLIB_OBJS = ${HOSTLIB_SRCS:%.c=${BUILD}/%.o} |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 412 | ALL_OBJS += ${HOSTLIB_OBJS} |
| 413 | |
Bill Richardson | 81a0b3d | 2013-02-28 13:53:09 -0800 | [diff] [blame] | 414 | # Sigh. For historical reasons, the autoupdate installer must sometimes be a |
| 415 | # 32-bit executable, even when everything else is 64-bit. But it only needs a |
| 416 | # few functions, so let's just build those. |
| 417 | TINYHOSTLIB = ${BUILD}/libtinyvboot_host.a |
| 418 | |
| 419 | TINYHOSTLIB_SRCS = \ |
Bill Richardson | 81a0b3d | 2013-02-28 13:53:09 -0800 | [diff] [blame] | 420 | cgpt/cgpt_add.c \ |
| 421 | cgpt/cgpt_boot.c \ |
Bill Richardson | 81a0b3d | 2013-02-28 13:53:09 -0800 | [diff] [blame] | 422 | cgpt/cgpt_common.c \ |
Bill Richardson | 7829902 | 2014-06-20 14:33:00 -0700 | [diff] [blame] | 423 | cgpt/cgpt_create.c \ |
| 424 | cgpt/cgpt_prioritize.c \ |
Bill Richardson | 18e0370 | 2014-06-23 17:48:33 -0700 | [diff] [blame] | 425 | cgpt/flash_ts.c \ |
Albert Chaulk | 534723a | 2013-03-20 14:46:50 -0700 | [diff] [blame] | 426 | cgpt/flash_ts_drv.c \ |
Bill Richardson | 7829902 | 2014-06-20 14:33:00 -0700 | [diff] [blame] | 427 | firmware/lib/cgptlib/cgptlib_internal.c \ |
| 428 | firmware/lib/cgptlib/crc32.c \ |
Albert Chaulk | b334e65 | 2013-03-28 15:25:33 -0700 | [diff] [blame] | 429 | firmware/lib/cgptlib/mtdlib.c \ |
Bill Richardson | 5fed2a6 | 2013-03-04 15:11:38 -0800 | [diff] [blame] | 430 | firmware/lib/utility_string.c \ |
Bill Richardson | 7829902 | 2014-06-20 14:33:00 -0700 | [diff] [blame] | 431 | firmware/stub/utility_stub.c \ |
| 432 | utility/dump_kernel_config_lib.c |
Bill Richardson | 81a0b3d | 2013-02-28 13:53:09 -0800 | [diff] [blame] | 433 | |
| 434 | TINYHOSTLIB_OBJS = ${TINYHOSTLIB_SRCS:%.c=${BUILD}/%.o} |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 435 | |
| 436 | # ---------------------------------------------------------------------------- |
| 437 | # Now for the userspace binaries |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 438 | |
| 439 | CGPT = ${BUILD}/cgpt/cgpt |
| 440 | |
| 441 | CGPT_SRCS = \ |
| 442 | cgpt/cgpt.c \ |
| 443 | cgpt/cgpt_add.c \ |
| 444 | cgpt/cgpt_boot.c \ |
| 445 | cgpt/cgpt_common.c \ |
| 446 | cgpt/cgpt_create.c \ |
| 447 | cgpt/cgpt_find.c \ |
| 448 | cgpt/cgpt_legacy.c \ |
| 449 | cgpt/cgpt_prioritize.c \ |
| 450 | cgpt/cgpt_repair.c \ |
| 451 | cgpt/cgpt_show.c \ |
| 452 | cgpt/cmd_add.c \ |
| 453 | cgpt/cmd_boot.c \ |
| 454 | cgpt/cmd_create.c \ |
| 455 | cgpt/cmd_find.c \ |
| 456 | cgpt/cmd_legacy.c \ |
| 457 | cgpt/cmd_prioritize.c \ |
| 458 | cgpt/cmd_repair.c \ |
Albert Chaulk | 534723a | 2013-03-20 14:46:50 -0700 | [diff] [blame] | 459 | cgpt/cmd_show.c \ |
Bill Richardson | 18e0370 | 2014-06-23 17:48:33 -0700 | [diff] [blame] | 460 | cgpt/flash_ts.c \ |
| 461 | cgpt/flash_ts_drv.c |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 462 | |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 463 | CGPT_OBJS = ${CGPT_SRCS:%.c=${BUILD}/%.o} |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 464 | ALL_OBJS += ${CGPT_OBJS} |
| 465 | |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 466 | |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 467 | # Scripts to install directly (not compiled) |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 468 | UTIL_SCRIPTS = \ |
| 469 | utility/dev_debug_vboot \ |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 470 | utility/enable_dev_usb_boot \ |
| 471 | utility/vbutil_what_keys |
| 472 | |
Bill Richardson | c9bf348 | 2013-02-13 14:38:29 -0800 | [diff] [blame] | 473 | ifeq (${MINIMAL},) |
| 474 | UTIL_SCRIPTS += \ |
| 475 | utility/dev_make_keypair |
| 476 | endif |
| 477 | |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 478 | # These utilities should be linked statically. |
| 479 | UTIL_NAMES_STATIC = \ |
Bill Richardson | 339f7e0 | 2013-04-05 09:49:24 -0700 | [diff] [blame] | 480 | utility/crossystem \ |
Bill Richardson | 339f7e0 | 2013-04-05 09:49:24 -0700 | [diff] [blame] | 481 | utility/gbb_utility |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 482 | |
| 483 | UTIL_NAMES = ${UTIL_NAMES_STATIC} \ |
Bill Richardson | 339f7e0 | 2013-04-05 09:49:24 -0700 | [diff] [blame] | 484 | utility/dev_sign_file \ |
| 485 | utility/dump_kernel_config \ |
| 486 | utility/dumpRSAPublicKey \ |
| 487 | utility/tpm_init_temp_fix \ |
| 488 | utility/tpmc \ |
| 489 | utility/vbutil_firmware \ |
| 490 | utility/vbutil_kernel \ |
| 491 | utility/vbutil_key \ |
| 492 | utility/vbutil_keyblock \ |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 493 | |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 494 | ifeq (${MINIMAL},) |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 495 | UTIL_NAMES += \ |
Bill Richardson | 339f7e0 | 2013-04-05 09:49:24 -0700 | [diff] [blame] | 496 | utility/bmpblk_font \ |
| 497 | utility/bmpblk_utility \ |
| 498 | utility/eficompress \ |
| 499 | utility/efidecompress \ |
| 500 | utility/load_kernel_test \ |
| 501 | utility/pad_digest_utility \ |
| 502 | utility/signature_digest_utility \ |
| 503 | utility/verify_data |
Randall Spangler | a7ab8b5 | 2014-06-10 17:05:08 -0700 | [diff] [blame] | 504 | |
| 505 | ifneq (${VBOOT2},) |
| 506 | UTIL_NAMES += \ |
| 507 | utility/vb2_verify_fw |
| 508 | endif |
| 509 | |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 510 | endif |
| 511 | |
Bill Richardson | 339f7e0 | 2013-04-05 09:49:24 -0700 | [diff] [blame] | 512 | UTIL_BINS_STATIC := $(addprefix ${BUILD}/,${UTIL_NAMES_STATIC}) |
| 513 | UTIL_BINS = $(addprefix ${BUILD}/,${UTIL_NAMES}) |
Bill Richardson | 1912bba | 2013-04-04 21:08:50 -0700 | [diff] [blame] | 514 | ALL_OBJS += $(addsuffix .o,${UTIL_BINS} ${UTIL_BINS_STATIC}) |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 515 | |
Bill Richardson | c9bf348 | 2013-02-13 14:38:29 -0800 | [diff] [blame] | 516 | |
| 517 | # Scripts for signing stuff. |
| 518 | SIGNING_SCRIPTS = \ |
| 519 | utility/tpm-nvsize \ |
| 520 | utility/chromeos-tpm-recovery |
| 521 | |
| 522 | # These go in a different place. |
| 523 | SIGNING_SCRIPTS_DEV = \ |
| 524 | scripts/image_signing/resign_firmwarefd.sh \ |
| 525 | scripts/image_signing/make_dev_firmware.sh \ |
| 526 | scripts/image_signing/make_dev_ssd.sh \ |
| 527 | scripts/image_signing/set_gbb_flags.sh |
| 528 | |
| 529 | # Installed, but not made executable. |
| 530 | SIGNING_COMMON = scripts/image_signing/common_minimal.sh |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 531 | |
Bill Richardson | 826db09 | 2013-01-14 12:37:15 -0800 | [diff] [blame] | 532 | |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 533 | # The unified firmware utility will eventually replace all the others |
| 534 | FUTIL_BIN = ${BUILD}/futility/futility |
Bill Richardson | 6db8c75 | 2013-04-05 13:30:43 -0700 | [diff] [blame] | 535 | # But we still need both static (tiny) and dynamic (with openssl) versions. |
| 536 | FUTIL_STATIC_BIN = ${FUTIL_BIN}_s |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 537 | |
Bill Richardson | feb2518 | 2013-03-07 12:54:29 -0800 | [diff] [blame] | 538 | # These are the others it will replace. |
Bill Richardson | 20807b6 | 2013-04-09 10:15:26 -0700 | [diff] [blame] | 539 | FUTIL_OLD = bmpblk_font bmpblk_utility cgpt chromeos-tpm-recovery crossystem \ |
| 540 | dev_debug_vboot dev_make_keypair dev_sign_file dumpRSAPublicKey \ |
| 541 | dump_fmap dump_kernel_config eficompress efidecompress \ |
| 542 | enable_dev_usb_boot gbb_utility load_kernel_test \ |
| 543 | make_dev_firmware.sh make_dev_ssd.sh pad_digest_utility \ |
| 544 | resign_firmwarefd.sh set_gbb_flags.sh signature_digest_utility \ |
| 545 | tpm-nvsize tpm_init_temp_fix tpmc vbutil_firmware vbutil_kernel \ |
| 546 | vbutil_key vbutil_keyblock vbutil_what_keys verify_data |
Bill Richardson | feb2518 | 2013-03-07 12:54:29 -0800 | [diff] [blame] | 547 | |
Bill Richardson | 6db8c75 | 2013-04-05 13:30:43 -0700 | [diff] [blame] | 548 | FUTIL_STATIC_SRCS = \ |
Bill Richardson | feb2518 | 2013-03-07 12:54:29 -0800 | [diff] [blame] | 549 | futility/futility.c \ |
Bill Richardson | 20807b6 | 2013-04-09 10:15:26 -0700 | [diff] [blame] | 550 | futility/cmd_dump_fmap.c \ |
Bill Richardson | feb2518 | 2013-03-07 12:54:29 -0800 | [diff] [blame] | 551 | futility/cmd_foo.c |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 552 | |
Bill Richardson | 6db8c75 | 2013-04-05 13:30:43 -0700 | [diff] [blame] | 553 | FUTIL_SRCS = \ |
| 554 | $(FUTIL_STATIC_SRCS) \ |
| 555 | futility/cmd_hey.c |
| 556 | |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 557 | FUTIL_LDS = futility/futility.lds |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 558 | |
Bill Richardson | 6db8c75 | 2013-04-05 13:30:43 -0700 | [diff] [blame] | 559 | FUTIL_STATIC_OBJS = ${FUTIL_STATIC_SRCS:%.c=${BUILD}/%.o} |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 560 | FUTIL_OBJS = ${FUTIL_SRCS:%.c=${BUILD}/%.o} |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 561 | |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 562 | ALL_OBJS += ${FUTIL_OBJS} |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 563 | |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 564 | |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 565 | # Library of handy test functions. |
| 566 | TESTLIB = ${BUILD}/tests/test.a |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 567 | |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 568 | TESTLIB_SRCS = \ |
| 569 | tests/test_common.c \ |
| 570 | tests/timer_utils.c \ |
| 571 | tests/crc32_test.c |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 572 | |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 573 | TESTLIB_OBJS = ${TESTLIB_SRCS:%.c=${BUILD}/%.o} |
| 574 | ALL_OBJS += ${TESTLIB_OBJS} |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 575 | |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 576 | |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 577 | # And some compiled tests. |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 578 | TEST_NAMES = \ |
Bill Richardson | 339f7e0 | 2013-04-05 09:49:24 -0700 | [diff] [blame] | 579 | tests/cgptlib_test \ |
| 580 | tests/rollback_index2_tests \ |
| 581 | tests/rollback_index3_tests \ |
| 582 | tests/rsa_padding_test \ |
| 583 | tests/rsa_utility_tests \ |
| 584 | tests/rsa_verify_benchmark \ |
| 585 | tests/sha_benchmark \ |
| 586 | tests/sha_tests \ |
| 587 | tests/stateful_util_tests \ |
| 588 | tests/tlcl_tests \ |
| 589 | tests/tpm_bootmode_tests \ |
| 590 | tests/utility_string_tests \ |
| 591 | tests/utility_tests \ |
| 592 | tests/vboot_api_init_tests \ |
| 593 | tests/vboot_api_devmode_tests \ |
| 594 | tests/vboot_api_firmware_tests \ |
| 595 | tests/vboot_api_kernel_tests \ |
| 596 | tests/vboot_api_kernel2_tests \ |
| 597 | tests/vboot_api_kernel3_tests \ |
| 598 | tests/vboot_api_kernel4_tests \ |
| 599 | tests/vboot_audio_tests \ |
| 600 | tests/vboot_common_tests \ |
| 601 | tests/vboot_common2_tests \ |
| 602 | tests/vboot_common3_tests \ |
| 603 | tests/vboot_display_tests \ |
| 604 | tests/vboot_firmware_tests \ |
| 605 | tests/vboot_kernel_tests \ |
| 606 | tests/vboot_nvstorage_test \ |
| 607 | tests/futility/test_not_really |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 608 | |
Simon Glass | 527ba81 | 2013-07-25 08:48:47 -0600 | [diff] [blame] | 609 | ifdef REGION_READ |
| 610 | TEST_NAMES += tests/vboot_region_tests |
| 611 | endif |
| 612 | |
Randall Spangler | 786acda | 2014-05-22 13:27:07 -0700 | [diff] [blame] | 613 | ifneq (${VBOOT2},) |
| 614 | TEST_NAMES += \ |
Randall Spangler | a7ab8b5 | 2014-06-10 17:05:08 -0700 | [diff] [blame] | 615 | tests/vb2_api_tests \ |
Randall Spangler | 786acda | 2014-05-22 13:27:07 -0700 | [diff] [blame] | 616 | tests/vb2_common_tests \ |
Randall Spangler | 7141d73 | 2014-05-15 15:34:54 -0700 | [diff] [blame] | 617 | tests/vb2_common2_tests \ |
| 618 | tests/vb2_common3_tests \ |
Randall Spangler | 3333e57 | 2014-05-14 11:37:52 -0700 | [diff] [blame] | 619 | tests/vb2_misc_tests \ |
Randall Spangler | 1803068 | 2014-06-11 16:01:08 -0700 | [diff] [blame] | 620 | tests/vb2_misc2_tests \ |
Randall Spangler | 3333e57 | 2014-05-14 11:37:52 -0700 | [diff] [blame] | 621 | tests/vb2_nvstorage_tests \ |
Randall Spangler | e166d04 | 2014-05-13 09:24:52 -0700 | [diff] [blame] | 622 | tests/vb2_rsa_padding_tests \ |
| 623 | tests/vb2_rsa_utility_tests \ |
Randall Spangler | 3333e57 | 2014-05-14 11:37:52 -0700 | [diff] [blame] | 624 | tests/vb2_secdata_tests \ |
Randall Spangler | e166d04 | 2014-05-13 09:24:52 -0700 | [diff] [blame] | 625 | tests/vb2_sha_tests \ |
Randall Spangler | 786acda | 2014-05-22 13:27:07 -0700 | [diff] [blame] | 626 | |
| 627 | endif |
| 628 | |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 629 | # TODO: port these tests to new API, if not already eqivalent |
| 630 | # functionality in other tests. These don't even compile at present. |
| 631 | # |
| 632 | # big_firmware_tests |
| 633 | # big_kernel_tests |
| 634 | # firmware_image_tests |
| 635 | # firmware_rollback_tests |
| 636 | # firmware_splicing_tests |
| 637 | # firmware_verify_benchmark |
| 638 | # kernel_image_tests |
| 639 | # kernel_rollback_tests |
| 640 | # kernel_splicing_tests |
| 641 | # kernel_verify_benchmark |
| 642 | # rollback_index_test |
| 643 | # verify_firmware_fuzz_driver |
| 644 | # verify_kernel_fuzz_driver |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 645 | # utility/load_firmware_test |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 646 | |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 647 | # And a few more... |
Bill Richardson | 339f7e0 | 2013-04-05 09:49:24 -0700 | [diff] [blame] | 648 | TLCL_TEST_NAMES = \ |
| 649 | tests/tpm_lite/tpmtest_earlyextend \ |
| 650 | tests/tpm_lite/tpmtest_earlynvram \ |
| 651 | tests/tpm_lite/tpmtest_earlynvram2 \ |
| 652 | tests/tpm_lite/tpmtest_enable \ |
| 653 | tests/tpm_lite/tpmtest_fastenable \ |
| 654 | tests/tpm_lite/tpmtest_globallock \ |
| 655 | tests/tpm_lite/tpmtest_redefine_unowned \ |
| 656 | tests/tpm_lite/tpmtest_spaceperm \ |
| 657 | tests/tpm_lite/tpmtest_testsetup \ |
| 658 | tests/tpm_lite/tpmtest_timing \ |
| 659 | tests/tpm_lite/tpmtest_writelimit |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 660 | |
| 661 | TEST_NAMES += ${TLCL_TEST_NAMES} |
| 662 | |
Bill Richardson | 339f7e0 | 2013-04-05 09:49:24 -0700 | [diff] [blame] | 663 | # Finally |
| 664 | TEST_BINS = $(addprefix ${BUILD}/,${TEST_NAMES}) |
Bill Richardson | 1912bba | 2013-04-04 21:08:50 -0700 | [diff] [blame] | 665 | ALL_OBJS += $(addsuffix .o,${TEST_BINS}) |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 666 | |
Randall Spangler | e061a25 | 2013-01-22 15:34:07 -0800 | [diff] [blame] | 667 | # Directory containing test keys |
| 668 | TEST_KEYS = ${SRC_RUN}/tests/testkeys |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 669 | |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 670 | |
| 671 | ############################################################################## |
| 672 | # Finally, some targets. High-level ones first. |
| 673 | |
| 674 | # Create output directories if necessary. Do this via explicit shell commands |
| 675 | # so it happens before trying to generate/include dependencies. |
| 676 | SUBDIRS := firmware host cgpt utility futility tests tests/tpm_lite |
| 677 | _dir_create := $(foreach d, \ |
| 678 | $(shell find ${SUBDIRS} -name '*.c' -exec dirname {} \; | sort -u), \ |
| 679 | $(shell [ -d ${BUILD}/${d} ] || mkdir -p ${BUILD}/${d})) |
| 680 | |
| 681 | |
| 682 | # Default target. |
| 683 | .PHONY: all |
Randall Spangler | 786acda | 2014-05-22 13:27:07 -0700 | [diff] [blame] | 684 | all: fwlib $(if ${VBOOT2},fwlib2) $(if ${FIRMWARE_ARCH},,host_stuff) \ |
| 685 | $(if ${COV},coverage) |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 686 | |
| 687 | # Host targets |
| 688 | .PHONY: host_stuff |
Bill Richardson | bc2d2b2 | 2014-07-09 21:11:12 -0700 | [diff] [blame] | 689 | host_stuff: utillib hostlib cgpt utils futil tests |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 690 | |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 691 | .PHONY: clean |
| 692 | clean: |
| 693 | ${Q}/bin/rm -rf ${BUILD} |
| 694 | |
| 695 | .PHONY: install |
Bill Richardson | c9bf348 | 2013-02-13 14:38:29 -0800 | [diff] [blame] | 696 | install: cgpt_install utils_install signing_install futil_install |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 697 | |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 698 | # Don't delete intermediate object files |
| 699 | .SECONDARY: |
| 700 | |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 701 | |
| 702 | # ---------------------------------------------------------------------------- |
| 703 | # Firmware library |
| 704 | |
| 705 | # TPM-specific flags. These depend on the particular TPM we're targeting for. |
| 706 | # They are needed here only for compiling parts of the firmware code into |
| 707 | # user-level tests. |
| 708 | |
| 709 | # TPM_BLOCKING_CONTINUESELFTEST is defined if TPM_ContinueSelfTest blocks until |
| 710 | # the self test has completed. |
| 711 | |
Randall Spangler | 45cc0f2 | 2013-01-25 09:34:26 -0800 | [diff] [blame] | 712 | ${FWLIB_OBJS}: CFLAGS += -DTPM_BLOCKING_CONTINUESELFTEST |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 713 | |
| 714 | # TPM_MANUAL_SELFTEST is defined if the self test must be started manually |
| 715 | # (with a call to TPM_ContinueSelfTest) instead of starting automatically at |
| 716 | # power on. |
| 717 | # |
| 718 | # We sincerely hope that TPM_BLOCKING_CONTINUESELFTEST and TPM_MANUAL_SELFTEST |
| 719 | # are not both defined at the same time. (See comment in code.) |
| 720 | |
| 721 | # CFLAGS += -DTPM_MANUAL_SELFTEST |
| 722 | |
| 723 | ifeq (${FIRMWARE_ARCH},i386) |
| 724 | # Unrolling loops in cryptolib makes it faster |
Randall Spangler | 45cc0f2 | 2013-01-25 09:34:26 -0800 | [diff] [blame] | 725 | ${FWLIB_OBJS}: CFLAGS += -DUNROLL_LOOPS |
Randall Spangler | 786acda | 2014-05-22 13:27:07 -0700 | [diff] [blame] | 726 | ${FWLIB2_OBJS}: CFLAGS += -DUNROLL_LOOPS |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 727 | |
| 728 | # Workaround for coreboot on x86, which will power off asynchronously |
| 729 | # without giving us a chance to react. This is not an example of the Right |
| 730 | # Way to do things. See chrome-os-partner:7689, and the commit message |
| 731 | # that made this change. |
Randall Spangler | 45cc0f2 | 2013-01-25 09:34:26 -0800 | [diff] [blame] | 732 | ${FWLIB_OBJS}: CFLAGS += -DSAVE_LOCALE_IMMEDIATELY |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 733 | |
| 734 | # On x86 we don't actually read the GBB data into RAM until it is needed. |
| 735 | # Therefore it makes sense to cache it rather than reading it each time. |
| 736 | # Enable this feature. |
Randall Spangler | 45cc0f2 | 2013-01-25 09:34:26 -0800 | [diff] [blame] | 737 | ${FWLIB_OBJS}: CFLAGS += -DCOPY_BMP_DATA |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 738 | endif |
| 739 | |
Simon Glass | 527ba81 | 2013-07-25 08:48:47 -0600 | [diff] [blame] | 740 | ifdef REGION_READ |
| 741 | ${FWLIB_OBJS}: CFLAGS += -DREGION_READ |
| 742 | endif |
| 743 | |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 744 | ifeq (${FIRMWARE_ARCH},) |
| 745 | # Disable rollback TPM when compiling locally, since otherwise |
| 746 | # load_kernel_test attempts to talk to the TPM. |
Randall Spangler | 45cc0f2 | 2013-01-25 09:34:26 -0800 | [diff] [blame] | 747 | ${FWLIB_OBJS}: CFLAGS += -DDISABLE_ROLLBACK_TPM |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 748 | endif |
| 749 | |
Bill Richardson | a130e0b | 2013-04-04 18:16:39 -0700 | [diff] [blame] | 750 | # Linktest ensures firmware lib doesn't rely on outside libraries |
| 751 | ${BUILD}/firmware/linktest/main_vbinit: ${VBINIT_OBJS} |
Randall Spangler | 9394326 | 2013-02-26 11:03:57 -0800 | [diff] [blame] | 752 | ${BUILD}/firmware/linktest/main_vbinit: OBJS = ${VBINIT_OBJS} |
Bill Richardson | 1912bba | 2013-04-04 21:08:50 -0700 | [diff] [blame] | 753 | ALL_OBJS += ${BUILD}/firmware/linktest/main_vbinit.o |
Bill Richardson | a130e0b | 2013-04-04 18:16:39 -0700 | [diff] [blame] | 754 | ${BUILD}/firmware/linktest/main_vbsf: ${VBSF_OBJS} |
Randall Spangler | 9394326 | 2013-02-26 11:03:57 -0800 | [diff] [blame] | 755 | ${BUILD}/firmware/linktest/main_vbsf: OBJS = ${VBSF_OBJS} |
Bill Richardson | 1912bba | 2013-04-04 21:08:50 -0700 | [diff] [blame] | 756 | ALL_OBJS += ${BUILD}/firmware/linktest/main_vbsf.o |
Bill Richardson | a130e0b | 2013-04-04 18:16:39 -0700 | [diff] [blame] | 757 | ${BUILD}/firmware/linktest/main: ${FWLIB} |
| 758 | ${BUILD}/firmware/linktest/main: LIBS = ${FWLIB} |
Bill Richardson | 1912bba | 2013-04-04 21:08:50 -0700 | [diff] [blame] | 759 | ALL_OBJS += ${BUILD}/firmware/linktest/main.o |
Randall Spangler | 9394326 | 2013-02-26 11:03:57 -0800 | [diff] [blame] | 760 | |
Bill Richardson | d2d08b2 | 2014-07-08 16:31:40 -0700 | [diff] [blame] | 761 | .PHONY: fwlinktest |
| 762 | fwlinktest: \ |
Randall Spangler | 9394326 | 2013-02-26 11:03:57 -0800 | [diff] [blame] | 763 | ${BUILD}/firmware/linktest/main_vbinit \ |
| 764 | ${BUILD}/firmware/linktest/main_vbsf \ |
| 765 | ${BUILD}/firmware/linktest/main |
| 766 | |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 767 | .PHONY: fwlib |
Bill Richardson | a130e0b | 2013-04-04 18:16:39 -0700 | [diff] [blame] | 768 | fwlib: $(if ${FIRMWARE_ARCH},${FWLIB},fwlinktest) |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 769 | |
Randall Spangler | 786acda | 2014-05-22 13:27:07 -0700 | [diff] [blame] | 770 | .PHONY: fwlib2 |
| 771 | fwlib2: ${FWLIB2} |
| 772 | |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 773 | ${FWLIB}: ${FWLIB_OBJS} |
Simon Glass | 661ae9e | 2013-03-26 11:39:21 -0700 | [diff] [blame] | 774 | @$(PRINTF) " RM $(subst ${BUILD}/,,$@)\n" |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 775 | ${Q}rm -f $@ |
Simon Glass | 661ae9e | 2013-03-26 11:39:21 -0700 | [diff] [blame] | 776 | @$(PRINTF) " AR $(subst ${BUILD}/,,$@)\n" |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 777 | ${Q}ar qc $@ $^ |
| 778 | |
Randall Spangler | 786acda | 2014-05-22 13:27:07 -0700 | [diff] [blame] | 779 | ${FWLIB2}: ${FWLIB2_OBJS} |
| 780 | @$(PRINTF) " RM $(subst ${BUILD}/,,$@)\n" |
| 781 | ${Q}rm -f $@ |
| 782 | @$(PRINTF) " AR $(subst ${BUILD}/,,$@)\n" |
| 783 | ${Q}ar qc $@ $^ |
| 784 | |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 785 | # ---------------------------------------------------------------------------- |
Bill Richardson | 7829902 | 2014-06-20 14:33:00 -0700 | [diff] [blame] | 786 | # Host library(s) |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 787 | |
Bill Richardson | 7829902 | 2014-06-20 14:33:00 -0700 | [diff] [blame] | 788 | # Link tests for local utilities |
| 789 | ${BUILD}/host/linktest/main: ${UTILLIB} |
| 790 | ${BUILD}/host/linktest/main: INCLUDES += \ |
Bill Richardson | 0c3ba24 | 2013-03-29 11:09:30 -0700 | [diff] [blame] | 791 | -Ihost/include \ |
| 792 | -Ihost/arch/${ARCH}/include \ |
| 793 | -Ihost/lib/include |
Bill Richardson | 7829902 | 2014-06-20 14:33:00 -0700 | [diff] [blame] | 794 | ${BUILD}/host/linktest/main: LIBS = ${UTILLIB} |
| 795 | ALL_OBJS += ${BUILD}/host/linktest/main.o |
| 796 | |
| 797 | .PHONY: utillib |
| 798 | utillib: ${UTILLIB} \ |
| 799 | ${BUILD}/host/linktest/main |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 800 | |
| 801 | # TODO: better way to make .a than duplicating this recipe each time? |
Bill Richardson | 7829902 | 2014-06-20 14:33:00 -0700 | [diff] [blame] | 802 | ${UTILLIB}: ${UTILLIB_OBJS} ${FWLIB_OBJS} $(if ${VBOOT2},${FWLIB2_OBJS}) |
| 803 | @$(PRINTF) " RM $(subst ${BUILD}/,,$@)\n" |
| 804 | ${Q}rm -f $@ |
| 805 | @$(PRINTF) " AR $(subst ${BUILD}/,,$@)\n" |
| 806 | ${Q}ar qc $@ $^ |
| 807 | |
| 808 | |
| 809 | # Link tests for external repos |
| 810 | ${BUILD}/host/linktest/extern: ${HOSTLIB} |
| 811 | ${BUILD}/host/linktest/extern: INCLUDES += -Ihost/include |
| 812 | ${BUILD}/host/linktest/extern: LIBS = ${HOSTLIB} |
| 813 | ${BUILD}/host/linktest/extern: LDLIBS += -static |
| 814 | ALL_OBJS += ${BUILD}/host/linktest/extern.o |
| 815 | |
| 816 | .PHONY: hostlib |
| 817 | hostlib: ${HOSTLIB} \ |
| 818 | ${BUILD}/host/linktest/extern |
| 819 | |
| 820 | # TODO: better way to make .a than duplicating this recipe each time? |
| 821 | ${HOSTLIB}: INCLUDES += -Ihost/include -Ihost/lib/include |
| 822 | ${HOSTLIB}: ${HOSTLIB_OBJS} |
Simon Glass | 661ae9e | 2013-03-26 11:39:21 -0700 | [diff] [blame] | 823 | @$(PRINTF) " RM $(subst ${BUILD}/,,$@)\n" |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 824 | ${Q}rm -f $@ |
Simon Glass | 661ae9e | 2013-03-26 11:39:21 -0700 | [diff] [blame] | 825 | @$(PRINTF) " AR $(subst ${BUILD}/,,$@)\n" |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 826 | ${Q}ar qc $@ $^ |
| 827 | |
Bill Richardson | 81a0b3d | 2013-02-28 13:53:09 -0800 | [diff] [blame] | 828 | |
| 829 | # Ugh. This is a very cut-down version of HOSTLIB just for the installer. |
| 830 | .PHONY: tinyhostlib |
| 831 | tinyhostlib: ${TINYHOSTLIB} |
| 832 | ${Q}cp -f ${TINYHOSTLIB} ${HOSTLIB} |
| 833 | |
Bill Richardson | 7829902 | 2014-06-20 14:33:00 -0700 | [diff] [blame] | 834 | ${TINYHOSTLIB}: INCLUDES += -Ihost/include -Ihost/lib/include |
Bill Richardson | 81a0b3d | 2013-02-28 13:53:09 -0800 | [diff] [blame] | 835 | ${TINYHOSTLIB}: ${TINYHOSTLIB_OBJS} |
Simon Glass | 661ae9e | 2013-03-26 11:39:21 -0700 | [diff] [blame] | 836 | @$(PRINTF) " RM $(subst ${BUILD}/,,$@)\n" |
Bill Richardson | 81a0b3d | 2013-02-28 13:53:09 -0800 | [diff] [blame] | 837 | ${Q}rm -f $@ |
Simon Glass | 661ae9e | 2013-03-26 11:39:21 -0700 | [diff] [blame] | 838 | @$(PRINTF) " AR $(subst ${BUILD}/,,$@)\n" |
Bill Richardson | 81a0b3d | 2013-02-28 13:53:09 -0800 | [diff] [blame] | 839 | ${Q}ar qc $@ $^ |
| 840 | |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 841 | # ---------------------------------------------------------------------------- |
| 842 | # CGPT library and utility |
| 843 | |
| 844 | .PHONY: cgpt |
| 845 | cgpt: ${CGPT} |
| 846 | |
Bill Richardson | 0c3ba24 | 2013-03-29 11:09:30 -0700 | [diff] [blame] | 847 | ${CGPT_OBJS}: INCLUDES += -Ihost/include |
| 848 | |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 849 | ${CGPT}: LDFLAGS += -static |
| 850 | ${CGPT}: LDLIBS += -luuid |
| 851 | |
Bill Richardson | 7829902 | 2014-06-20 14:33:00 -0700 | [diff] [blame] | 852 | ${CGPT}: ${CGPT_OBJS} ${UTILLIB} |
Simon Glass | 661ae9e | 2013-03-26 11:39:21 -0700 | [diff] [blame] | 853 | @$(PRINTF) " LDcgpt $(subst ${BUILD}/,,$@)\n" |
Bill Richardson | 6db8c75 | 2013-04-05 13:30:43 -0700 | [diff] [blame] | 854 | ${Q}${LD} -o ${CGPT} ${CFLAGS} ${LDFLAGS} $^ ${LDLIBS} |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 855 | |
| 856 | .PHONY: cgpt_install |
| 857 | cgpt_install: ${CGPT} |
Simon Glass | 661ae9e | 2013-03-26 11:39:21 -0700 | [diff] [blame] | 858 | @$(PRINTF) " INSTALL CGPT\n" |
Bill Richardson | c9bf348 | 2013-02-13 14:38:29 -0800 | [diff] [blame] | 859 | ${Q}mkdir -p ${UB_DIR} |
| 860 | ${Q}${INSTALL} -t ${UB_DIR} $^ |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 861 | |
| 862 | # ---------------------------------------------------------------------------- |
| 863 | # Utilities |
| 864 | |
| 865 | # These have their own headers too. |
Bill Richardson | 0c3ba24 | 2013-03-29 11:09:30 -0700 | [diff] [blame] | 866 | ${BUILD}/utility/%: INCLUDES += \ |
| 867 | -Ihost/include \ |
| 868 | -Ihost/lib/include \ |
| 869 | -Iutility/include |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 870 | |
| 871 | # Utilities for auto-update toolkits must be statically linked. |
| 872 | ${UTIL_BINS_STATIC}: LDFLAGS += -static |
| 873 | |
Bill Richardson | a130e0b | 2013-04-04 18:16:39 -0700 | [diff] [blame] | 874 | |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 875 | .PHONY: utils |
Bill Richardson | c7c6e5d | 2013-02-28 10:10:29 -0800 | [diff] [blame] | 876 | utils: ${UTIL_BINS} ${UTIL_SCRIPTS} |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 877 | ${Q}cp -f ${UTIL_SCRIPTS} ${BUILD}/utility |
| 878 | ${Q}chmod a+rx $(patsubst %,${BUILD}/%,${UTIL_SCRIPTS}) |
| 879 | |
Bill Richardson | 7829902 | 2014-06-20 14:33:00 -0700 | [diff] [blame] | 880 | ${UTIL_BINS} ${UTIL_BINS_STATIC}: ${UTILLIB} |
| 881 | ${UTIL_BINS} ${UTIL_BINS_STATIC}: LIBS = ${UTILLIB} |
Bill Richardson | a130e0b | 2013-04-04 18:16:39 -0700 | [diff] [blame] | 882 | |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 883 | .PHONY: utils_install |
Bill Richardson | c7c6e5d | 2013-02-28 10:10:29 -0800 | [diff] [blame] | 884 | utils_install: ${UTIL_BINS} ${UTIL_SCRIPTS} |
Simon Glass | 661ae9e | 2013-03-26 11:39:21 -0700 | [diff] [blame] | 885 | @$(PRINTF) " INSTALL UTILS\n" |
Bill Richardson | c9bf348 | 2013-02-13 14:38:29 -0800 | [diff] [blame] | 886 | ${Q}mkdir -p ${UB_DIR} |
| 887 | ${Q}${INSTALL} -t ${UB_DIR} ${UTIL_BINS} ${UTIL_SCRIPTS} |
Bill Richardson | c9bf348 | 2013-02-13 14:38:29 -0800 | [diff] [blame] | 888 | |
| 889 | # And some signing stuff for the target |
| 890 | .PHONY: signing_install |
| 891 | signing_install: ${SIGNING_SCRIPTS} ${SIGNING_SCRIPTS_DEV} ${SIGNING_COMMON} |
Simon Glass | 661ae9e | 2013-03-26 11:39:21 -0700 | [diff] [blame] | 892 | @$(PRINTF) " INSTALL SIGNING\n" |
Bill Richardson | c9bf348 | 2013-02-13 14:38:29 -0800 | [diff] [blame] | 893 | ${Q}mkdir -p ${UB_DIR} |
| 894 | ${Q}${INSTALL} -t ${UB_DIR} ${SIGNING_SCRIPTS} |
Bill Richardson | feb2518 | 2013-03-07 12:54:29 -0800 | [diff] [blame] | 895 | ${Q}${INSTALL} -t ${UB_DIR} ${SIGNING_SCRIPTS_DEV} |
| 896 | ${Q}${INSTALL} -t ${UB_DIR} -m 'u=rw,go=r,a-s' ${SIGNING_COMMON} |
| 897 | ifneq (${VB_DIR},) |
Bill Richardson | c9bf348 | 2013-02-13 14:38:29 -0800 | [diff] [blame] | 898 | ${Q}mkdir -p ${VB_DIR} |
Bill Richardson | feb2518 | 2013-03-07 12:54:29 -0800 | [diff] [blame] | 899 | ${Q}for prog in $(notdir ${SIGNING_SCRIPTS_DEV}); do \ |
| 900 | ln -sf "${FT_DIR}/futility" "${VB_DIR}/$$prog"; done |
Bill Richardson | c9bf348 | 2013-02-13 14:38:29 -0800 | [diff] [blame] | 901 | endif |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 902 | |
| 903 | # ---------------------------------------------------------------------------- |
| 904 | # new Firmware Utility |
| 905 | |
| 906 | .PHONY: futil |
Bill Richardson | 6db8c75 | 2013-04-05 13:30:43 -0700 | [diff] [blame] | 907 | futil: ${FUTIL_STATIC_BIN} ${FUTIL_BIN} |
| 908 | |
| 909 | ${FUTIL_STATIC_BIN}: ${FUTIL_LDS} ${FUTIL_STATIC_OBJS} |
| 910 | @$(PRINTF) " LD $(subst ${BUILD}/,,$@)\n" |
| 911 | ${Q}${LD} -o $@ ${CFLAGS} ${LDFLAGS} -static $^ ${LDLIBS} |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 912 | |
| 913 | ${FUTIL_BIN}: ${FUTIL_LDS} ${FUTIL_OBJS} |
Simon Glass | 661ae9e | 2013-03-26 11:39:21 -0700 | [diff] [blame] | 914 | @$(PRINTF) " LD $(subst ${BUILD}/,,$@)\n" |
Bill Richardson | 6db8c75 | 2013-04-05 13:30:43 -0700 | [diff] [blame] | 915 | ${Q}${LD} -o $@ ${CFLAGS} ${LDFLAGS} $^ ${LDLIBS} |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 916 | |
| 917 | .PHONY: futil_install |
| 918 | futil_install: ${FUTIL_BIN} |
Simon Glass | 661ae9e | 2013-03-26 11:39:21 -0700 | [diff] [blame] | 919 | @$(PRINTF) " INSTALL futility\n" |
Bill Richardson | feb2518 | 2013-03-07 12:54:29 -0800 | [diff] [blame] | 920 | ${Q}mkdir -p ${F_DIR} |
Bill Richardson | 6db8c75 | 2013-04-05 13:30:43 -0700 | [diff] [blame] | 921 | ${Q}${INSTALL} -t ${F_DIR} ${FUTIL_BIN} ${FUTIL_STATIC_BIN} |
Bill Richardson | feb2518 | 2013-03-07 12:54:29 -0800 | [diff] [blame] | 922 | ${Q}for prog in ${FUTIL_OLD}; do \ |
| 923 | ln -sf futility "${F_DIR}/$$prog"; done |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 924 | |
Bill Richardson | 20807b6 | 2013-04-09 10:15:26 -0700 | [diff] [blame] | 925 | # TODO(wfrichar): This will need some refactoring (crbug.com/228932) |
Bill Richardson | 7829902 | 2014-06-20 14:33:00 -0700 | [diff] [blame] | 926 | ${BUILD}/futility/% ${UTILLIB}: INCLUDES += \ |
Bill Richardson | 20807b6 | 2013-04-09 10:15:26 -0700 | [diff] [blame] | 927 | -Ihost/include \ |
| 928 | -Ihost/arch/${ARCH}/include \ |
| 929 | -Ihost/lib/include |
Bill Richardson | 7829902 | 2014-06-20 14:33:00 -0700 | [diff] [blame] | 930 | ${FUTIL_STATIC_BIN} ${FUTIL_BIN}: ${UTILLIB} |
| 931 | ${FUTIL_STATIC_BIN} ${FUTIL_BIN}: LIBS = ${UTILLIB} |
Bill Richardson | 20807b6 | 2013-04-09 10:15:26 -0700 | [diff] [blame] | 932 | |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 933 | # ---------------------------------------------------------------------------- |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 934 | # Utility to generate TLCL structure definition header file. |
| 935 | |
| 936 | ${BUILD}/utility/tlcl_generator: CFLAGS += -fpack-struct |
| 937 | |
| 938 | STRUCTURES_TMP=${BUILD}/tlcl_structures.tmp |
| 939 | STRUCTURES_SRC=firmware/lib/tpm_lite/include/tlcl_structures.h |
| 940 | |
| 941 | .PHONY: update_tlcl_structures |
| 942 | update_tlcl_structures: ${BUILD}/utility/tlcl_generator |
Simon Glass | 661ae9e | 2013-03-26 11:39:21 -0700 | [diff] [blame] | 943 | @$(PRINTF) " Rebuilding TLCL structures\n" |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 944 | ${Q}${BUILD}/utility/tlcl_generator > ${STRUCTURES_TMP} |
| 945 | ${Q}cmp -s ${STRUCTURES_TMP} ${STRUCTURES_SRC} || \ |
| 946 | ( echo "%% Updating structures.h %%" && \ |
| 947 | cp ${STRUCTURES_TMP} ${STRUCTURES_SRC} ) |
| 948 | |
| 949 | # ---------------------------------------------------------------------------- |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 950 | # Tests |
| 951 | |
| 952 | .PHONY: tests |
| 953 | tests: ${TEST_BINS} |
| 954 | |
Bill Richardson | 7829902 | 2014-06-20 14:33:00 -0700 | [diff] [blame] | 955 | ${TEST_BINS}: ${UTILLIB} ${TESTLIB} |
Bill Richardson | 339f7e0 | 2013-04-05 09:49:24 -0700 | [diff] [blame] | 956 | ${TEST_BINS}: INCLUDES += -Itests |
Bill Richardson | 7829902 | 2014-06-20 14:33:00 -0700 | [diff] [blame] | 957 | ${TEST_BINS}: LIBS = ${UTILLIB} ${TESTLIB} |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 958 | |
| 959 | ${TESTLIB}: ${TESTLIB_OBJS} |
Simon Glass | 661ae9e | 2013-03-26 11:39:21 -0700 | [diff] [blame] | 960 | @$(PRINTF) " RM $(subst ${BUILD}/,,$@)\n" |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 961 | ${Q}rm -f $@ |
Simon Glass | 661ae9e | 2013-03-26 11:39:21 -0700 | [diff] [blame] | 962 | @$(PRINTF) " AR $(subst ${BUILD}/,,$@)\n" |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 963 | ${Q}ar qc $@ $^ |
| 964 | |
| 965 | |
| 966 | # ---------------------------------------------------------------------------- |
| 967 | # Generic build rules. LIBS and OBJS can be overridden to tweak the generic |
| 968 | # rules for specific targets. |
| 969 | |
| 970 | ${BUILD}/%: ${BUILD}/%.o ${OBJS} ${LIBS} |
Simon Glass | 661ae9e | 2013-03-26 11:39:21 -0700 | [diff] [blame] | 971 | @$(PRINTF) " LD $(subst ${BUILD}/,,$@)\n" |
Bill Richardson | 6db8c75 | 2013-04-05 13:30:43 -0700 | [diff] [blame] | 972 | ${Q}${LD} -o $@ ${CFLAGS} ${LDFLAGS} $< ${OBJS} ${LIBS} ${LDLIBS} |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 973 | |
| 974 | ${BUILD}/%.o: %.c |
Simon Glass | 661ae9e | 2013-03-26 11:39:21 -0700 | [diff] [blame] | 975 | @$(PRINTF) " CC $(subst ${BUILD}/,,$@)\n" |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 976 | ${Q}${CC} ${CFLAGS} ${INCLUDES} -c -o $@ $< |
| 977 | |
| 978 | # Rules to recompile a single source file for library and test |
| 979 | # TODO: is there a tidier way to do this? |
| 980 | ${BUILD}/%_for_lib.o: CFLAGS += -DFOR_LIBRARY |
| 981 | ${BUILD}/%_for_lib.o: %.c |
Simon Glass | 661ae9e | 2013-03-26 11:39:21 -0700 | [diff] [blame] | 982 | @$(PRINTF) " CC-for-lib $(subst ${BUILD}/,,$@)\n" |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 983 | ${Q}${CC} ${CFLAGS} ${INCLUDES} -c -o $@ $< |
| 984 | |
| 985 | ${BUILD}/%_for_test.o: CFLAGS += -DFOR_TEST |
| 986 | ${BUILD}/%_for_test.o: %.c |
Simon Glass | 661ae9e | 2013-03-26 11:39:21 -0700 | [diff] [blame] | 987 | @$(PRINTF) " CC-for-test $(subst ${BUILD}/,,$@)\n" |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 988 | ${Q}${CC} ${CFLAGS} ${INCLUDES} -c -o $@ $< |
| 989 | |
| 990 | # TODO: C++ files don't belong in vboot reference at all. Convert to C. |
| 991 | ${BUILD}/%.o: %.cc |
Simon Glass | 661ae9e | 2013-03-26 11:39:21 -0700 | [diff] [blame] | 992 | @$(PRINTF) " CXX $(subst ${BUILD}/,,$@)\n" |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 993 | ${Q}${CXX} ${CFLAGS} ${INCLUDES} -c -o $@ $< |
| 994 | |
| 995 | # ---------------------------------------------------------------------------- |
| 996 | # Here are the special tweaks to the generic rules. |
| 997 | |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 998 | # GBB utility needs C++ linker. TODO: It shouldn't. |
| 999 | ${BUILD}/utility/gbb_utility: LD = ${CXX} |
| 1000 | |
Bill Richardson | feb2518 | 2013-03-07 12:54:29 -0800 | [diff] [blame] | 1001 | # Because we play some clever linker script games to add new commands without |
| 1002 | # changing any header files, futility must be linked with ld.bfd, not gold. |
| 1003 | ${FUTIL_BIN}: LDFLAGS += -fuse-ld=bfd |
Bill Richardson | 6db8c75 | 2013-04-05 13:30:43 -0700 | [diff] [blame] | 1004 | ${FUTIL_STATIC_BIN}: LDFLAGS += -fuse-ld=bfd |
Bill Richardson | feb2518 | 2013-03-07 12:54:29 -0800 | [diff] [blame] | 1005 | |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 1006 | # Some utilities need external crypto functions |
Bill Richardson | 7829902 | 2014-06-20 14:33:00 -0700 | [diff] [blame] | 1007 | CRYPTO_LIBS := $(shell ${PKG_CONFIG} --libs libcrypto) |
| 1008 | |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 1009 | ${BUILD}/utility/dumpRSAPublicKey: LDLIBS += ${CRYPTO_LIBS} |
| 1010 | ${BUILD}/utility/pad_digest_utility: LDLIBS += ${CRYPTO_LIBS} |
| 1011 | ${BUILD}/utility/signature_digest_utility: LDLIBS += ${CRYPTO_LIBS} |
| 1012 | ${BUILD}/utility/dev_sign_file: LDLIBS += ${CRYPTO_LIBS} |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 1013 | ${BUILD}/utility/vbutil_firmware: LDLIBS += ${CRYPTO_LIBS} |
| 1014 | ${BUILD}/utility/vbutil_kernel: LDLIBS += ${CRYPTO_LIBS} |
| 1015 | ${BUILD}/utility/vbutil_key: LDLIBS += ${CRYPTO_LIBS} |
| 1016 | ${BUILD}/utility/vbutil_keyblock: LDLIBS += ${CRYPTO_LIBS} |
| 1017 | |
| 1018 | ${BUILD}/host/linktest/main: LDLIBS += ${CRYPTO_LIBS} |
Randall Spangler | 7141d73 | 2014-05-15 15:34:54 -0700 | [diff] [blame] | 1019 | ${BUILD}/tests/vb2_common2_tests: LDLIBS += ${CRYPTO_LIBS} |
| 1020 | ${BUILD}/tests/vb2_common3_tests: LDLIBS += ${CRYPTO_LIBS} |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 1021 | ${BUILD}/tests/vboot_common2_tests: LDLIBS += ${CRYPTO_LIBS} |
| 1022 | ${BUILD}/tests/vboot_common3_tests: LDLIBS += ${CRYPTO_LIBS} |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 1023 | |
Bill Richardson | 18e0370 | 2014-06-23 17:48:33 -0700 | [diff] [blame] | 1024 | ${BUILD}/tests/cgptlib_test: OBJS += \ |
| 1025 | ${BUILD}/firmware/lib/cgptlib/mtdlib_unused.o |
| 1026 | ${BUILD}/tests/cgptlib_test: ${BUILD}/firmware/lib/cgptlib/mtdlib_unused.o |
| 1027 | |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 1028 | ${BUILD}/utility/bmpblk_utility: LD = ${CXX} |
| 1029 | ${BUILD}/utility/bmpblk_utility: LDLIBS = -llzma -lyaml |
| 1030 | |
| 1031 | BMPBLK_UTILITY_DEPS = \ |
| 1032 | ${BUILD}/utility/bmpblk_util.o \ |
| 1033 | ${BUILD}/utility/image_types.o \ |
| 1034 | ${BUILD}/utility/eficompress_for_lib.o \ |
| 1035 | ${BUILD}/utility/efidecompress_for_lib.o |
Bill Richardson | 1912bba | 2013-04-04 21:08:50 -0700 | [diff] [blame] | 1036 | |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 1037 | ${BUILD}/utility/bmpblk_utility: OBJS = ${BMPBLK_UTILITY_DEPS} |
| 1038 | ${BUILD}/utility/bmpblk_utility: ${BMPBLK_UTILITY_DEPS} |
Bill Richardson | 1912bba | 2013-04-04 21:08:50 -0700 | [diff] [blame] | 1039 | ALL_OBJS += ${BMPBLK_UTILITY_DEPS} |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 1040 | |
| 1041 | ${BUILD}/utility/bmpblk_font: OBJS += ${BUILD}/utility/image_types.o |
| 1042 | ${BUILD}/utility/bmpblk_font: ${BUILD}/utility/image_types.o |
Bill Richardson | 1912bba | 2013-04-04 21:08:50 -0700 | [diff] [blame] | 1043 | ALL_OBJS += ${BUILD}/utility/image_types.o |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 1044 | |
| 1045 | # Allow multiple definitions, so tests can mock functions from other libraries |
| 1046 | ${BUILD}/tests/%: CFLAGS += -Xlinker --allow-multiple-definition |
Bill Richardson | 0c3ba24 | 2013-03-29 11:09:30 -0700 | [diff] [blame] | 1047 | ${BUILD}/tests/%: INCLUDES += -Ihost/include -Ihost/lib/include |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 1048 | ${BUILD}/tests/%: LDLIBS += -lrt -luuid |
| 1049 | ${BUILD}/tests/%: LIBS += ${TESTLIB} |
| 1050 | |
| 1051 | ${BUILD}/tests/rollback_index2_tests: OBJS += \ |
| 1052 | ${BUILD}/firmware/lib/rollback_index_for_test.o |
| 1053 | ${BUILD}/tests/rollback_index2_tests: \ |
| 1054 | ${BUILD}/firmware/lib/rollback_index_for_test.o |
Bill Richardson | 1912bba | 2013-04-04 21:08:50 -0700 | [diff] [blame] | 1055 | ALL_OBJS += ${BUILD}/firmware/lib/rollback_index_for_test.o |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 1056 | |
Randall Spangler | c3d488d | 2013-01-28 16:23:48 -0800 | [diff] [blame] | 1057 | ${BUILD}/tests/tlcl_tests: OBJS += \ |
| 1058 | ${BUILD}/firmware/lib/tpm_lite/tlcl_for_test.o |
| 1059 | ${BUILD}/tests/tlcl_tests: \ |
| 1060 | ${BUILD}/firmware/lib/tpm_lite/tlcl_for_test.o |
Bill Richardson | 1912bba | 2013-04-04 21:08:50 -0700 | [diff] [blame] | 1061 | ALL_OBJS += ${BUILD}/firmware/lib/tpm_lite/tlcl_for_test.o |
Randall Spangler | c3d488d | 2013-01-28 16:23:48 -0800 | [diff] [blame] | 1062 | |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 1063 | ${BUILD}/tests/vboot_audio_tests: OBJS += \ |
| 1064 | ${BUILD}/firmware/lib/vboot_audio_for_test.o |
| 1065 | ${BUILD}/tests/vboot_audio_tests: \ |
| 1066 | ${BUILD}/firmware/lib/vboot_audio_for_test.o |
Bill Richardson | 1912bba | 2013-04-04 21:08:50 -0700 | [diff] [blame] | 1067 | ALL_OBJS += ${BUILD}/firmware/lib/vboot_audio_for_test.o |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 1068 | |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 1069 | ${BUILD}/tests/rollback_index_test: INCLUDES += -I/usr/include |
| 1070 | ${BUILD}/tests/rollback_index_test: LIBS += -ltlcl |
| 1071 | |
Bill Richardson | 339f7e0 | 2013-04-05 09:49:24 -0700 | [diff] [blame] | 1072 | TLCL_TEST_BINS = $(addprefix ${BUILD}/,${TLCL_TEST_NAMES}) |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 1073 | ${TLCL_TEST_BINS}: OBJS += ${BUILD}/tests/tpm_lite/tlcl_tests.o |
| 1074 | ${TLCL_TEST_BINS}: ${BUILD}/tests/tpm_lite/tlcl_tests.o |
Bill Richardson | 1912bba | 2013-04-04 21:08:50 -0700 | [diff] [blame] | 1075 | ALL_OBJS += ${BUILD}/tests/tpm_lite/tlcl_tests.o |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 1076 | |
| 1077 | ############################################################################## |
| 1078 | # Targets that exist just to run tests |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 1079 | |
| 1080 | # Frequently-run tests |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 1081 | .PHONY: test_targets |
Randall Spangler | 786acda | 2014-05-22 13:27:07 -0700 | [diff] [blame] | 1082 | test_targets:: runcgpttests runmisctests $(if ${VBOOT2},run2tests) |
Randall Spangler | 844bce5 | 2013-01-15 16:16:43 -0800 | [diff] [blame] | 1083 | |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 1084 | ifeq (${MINIMAL},) |
Randall Spangler | 844bce5 | 2013-01-15 16:16:43 -0800 | [diff] [blame] | 1085 | # Bitmap utility isn't compiled for minimal variant |
Bill Richardson | feb2518 | 2013-03-07 12:54:29 -0800 | [diff] [blame] | 1086 | test_targets:: runbmptests runfutiltests |
Randall Spangler | 844bce5 | 2013-01-15 16:16:43 -0800 | [diff] [blame] | 1087 | # Scripts don't work under qemu testing |
| 1088 | # TODO: convert scripts to makefile so they can be called directly |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 1089 | test_targets:: runtestscripts |
Randall Spangler | 844bce5 | 2013-01-15 16:16:43 -0800 | [diff] [blame] | 1090 | endif |
| 1091 | |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 1092 | .PHONY: test_setup |
| 1093 | test_setup:: cgpt utils futil tests |
| 1094 | |
Randall Spangler | 844bce5 | 2013-01-15 16:16:43 -0800 | [diff] [blame] | 1095 | # Qemu setup for cross-compiled tests. Need to copy qemu binary into the |
| 1096 | # sysroot. |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 1097 | ifneq (${QEMU_ARCH},) |
| 1098 | test_setup:: qemu_install |
Randall Spangler | 844bce5 | 2013-01-15 16:16:43 -0800 | [diff] [blame] | 1099 | |
| 1100 | .PHONY: qemu_install |
| 1101 | qemu_install: |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 1102 | ifeq (${SYSROOT},) |
| 1103 | $(error SYSROOT must be set to the top of the target-specific root \ |
| 1104 | when cross-compiling for qemu-based tests to run properly.) |
| 1105 | endif |
Simon Glass | 661ae9e | 2013-03-26 11:39:21 -0700 | [diff] [blame] | 1106 | @$(PRINTF) " Copying qemu binary.\n" |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 1107 | ${Q}cp -fu /usr/bin/${QEMU_BIN} ${BUILD}/${QEMU_BIN} |
| 1108 | ${Q}chmod a+rx ${BUILD}/${QEMU_BIN} |
Randall Spangler | 844bce5 | 2013-01-15 16:16:43 -0800 | [diff] [blame] | 1109 | endif |
| 1110 | |
Bill Richardson | acb2ee9 | 2013-01-11 22:53:00 -0800 | [diff] [blame] | 1111 | .PHONY: runtests |
Bill Richardson | a130e0b | 2013-04-04 18:16:39 -0700 | [diff] [blame] | 1112 | runtests: test_setup test_targets |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 1113 | |
| 1114 | # Generate test keys |
Bill Richardson | acb2ee9 | 2013-01-11 22:53:00 -0800 | [diff] [blame] | 1115 | .PHONY: genkeys |
Randall Spangler | 844bce5 | 2013-01-15 16:16:43 -0800 | [diff] [blame] | 1116 | genkeys: utils |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 1117 | tests/gen_test_keys.sh |
| 1118 | |
| 1119 | # Generate test cases for fuzzing |
Bill Richardson | acb2ee9 | 2013-01-11 22:53:00 -0800 | [diff] [blame] | 1120 | .PHONY: genfuzztestcases |
Randall Spangler | a808dc9 | 2013-01-14 12:59:05 -0800 | [diff] [blame] | 1121 | genfuzztestcases: utils |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 1122 | tests/gen_fuzz_test_cases.sh |
| 1123 | |
Bill Richardson | acb2ee9 | 2013-01-11 22:53:00 -0800 | [diff] [blame] | 1124 | .PHONY: runbmptests |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 1125 | runbmptests: test_setup |
| 1126 | cd tests/bitmaps && BMPBLK=${BUILD_RUN}/utility/bmpblk_utility \ |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 1127 | ./TestBmpBlock.py -v |
| 1128 | |
Bill Richardson | acb2ee9 | 2013-01-11 22:53:00 -0800 | [diff] [blame] | 1129 | .PHONY: runcgpttests |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 1130 | runcgpttests: test_setup |
| 1131 | ${RUNTEST} ${BUILD_RUN}/tests/cgptlib_test |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 1132 | |
Randall Spangler | 844bce5 | 2013-01-15 16:16:43 -0800 | [diff] [blame] | 1133 | .PHONY: runtestscripts |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 1134 | runtestscripts: test_setup genfuzztestcases |
| 1135 | tests/run_cgpt_tests.sh ${BUILD_RUN}/cgpt/cgpt |
Albert Chaulk | 42c08cb | 2013-04-02 14:38:07 -0700 | [diff] [blame] | 1136 | tests/run_cgpt_tests.sh ${BUILD_RUN}/cgpt/cgpt -N=512,32,1,3 |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 1137 | tests/run_preamble_tests.sh |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 1138 | tests/run_rsa_tests.sh |
Randall Spangler | 844bce5 | 2013-01-15 16:16:43 -0800 | [diff] [blame] | 1139 | tests/run_vbutil_kernel_arg_tests.sh |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 1140 | tests/run_vbutil_tests.sh |
Randall Spangler | e166d04 | 2014-05-13 09:24:52 -0700 | [diff] [blame] | 1141 | ifneq (${VBOOT2},) |
| 1142 | tests/vb2_rsa_tests.sh |
Randall Spangler | 539cbc2 | 2014-06-18 14:15:04 -0700 | [diff] [blame] | 1143 | tests/vb2_firmware_tests.sh |
Randall Spangler | e166d04 | 2014-05-13 09:24:52 -0700 | [diff] [blame] | 1144 | endif |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 1145 | |
Randall Spangler | 844bce5 | 2013-01-15 16:16:43 -0800 | [diff] [blame] | 1146 | .PHONY: runmisctests |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 1147 | runmisctests: test_setup |
| 1148 | ${RUNTEST} ${BUILD_RUN}/tests/rollback_index2_tests |
Randall Spangler | a3eac79 | 2013-01-23 13:04:05 -0800 | [diff] [blame] | 1149 | ${RUNTEST} ${BUILD_RUN}/tests/rollback_index3_tests |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 1150 | ${RUNTEST} ${BUILD_RUN}/tests/rsa_utility_tests |
| 1151 | ${RUNTEST} ${BUILD_RUN}/tests/sha_tests |
| 1152 | ${RUNTEST} ${BUILD_RUN}/tests/stateful_util_tests |
Randall Spangler | c3d488d | 2013-01-28 16:23:48 -0800 | [diff] [blame] | 1153 | ${RUNTEST} ${BUILD_RUN}/tests/tlcl_tests |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 1154 | ${RUNTEST} ${BUILD_RUN}/tests/tpm_bootmode_tests |
| 1155 | ${RUNTEST} ${BUILD_RUN}/tests/utility_string_tests |
| 1156 | ${RUNTEST} ${BUILD_RUN}/tests/utility_tests |
| 1157 | ${RUNTEST} ${BUILD_RUN}/tests/vboot_api_devmode_tests |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 1158 | ${RUNTEST} ${BUILD_RUN}/tests/vboot_api_firmware_tests |
Randall Spangler | 0714d9d | 2013-02-05 10:23:38 -0800 | [diff] [blame] | 1159 | ${RUNTEST} ${BUILD_RUN}/tests/vboot_api_init_tests |
| 1160 | ${RUNTEST} ${BUILD_RUN}/tests/vboot_api_kernel_tests |
Randall Spangler | 7f43669 | 2013-02-05 12:42:36 -0800 | [diff] [blame] | 1161 | ${RUNTEST} ${BUILD_RUN}/tests/vboot_api_kernel2_tests |
| 1162 | ${RUNTEST} ${BUILD_RUN}/tests/vboot_api_kernel3_tests |
| 1163 | ${RUNTEST} ${BUILD_RUN}/tests/vboot_api_kernel4_tests |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 1164 | ${RUNTEST} ${BUILD_RUN}/tests/vboot_audio_tests |
Randall Spangler | e061a25 | 2013-01-22 15:34:07 -0800 | [diff] [blame] | 1165 | ${RUNTEST} ${BUILD_RUN}/tests/vboot_common_tests |
| 1166 | ${RUNTEST} ${BUILD_RUN}/tests/vboot_common2_tests ${TEST_KEYS} |
| 1167 | ${RUNTEST} ${BUILD_RUN}/tests/vboot_common3_tests ${TEST_KEYS} |
Randall Spangler | 786a5dc | 2013-01-24 14:19:56 -0800 | [diff] [blame] | 1168 | ${RUNTEST} ${BUILD_RUN}/tests/vboot_display_tests |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 1169 | ${RUNTEST} ${BUILD_RUN}/tests/vboot_firmware_tests |
Randall Spangler | 49cb0d3 | 2013-01-29 14:28:16 -0800 | [diff] [blame] | 1170 | ${RUNTEST} ${BUILD_RUN}/tests/vboot_kernel_tests |
Randall Spangler | 6dbf9d9 | 2013-01-23 12:25:10 -0800 | [diff] [blame] | 1171 | ${RUNTEST} ${BUILD_RUN}/tests/vboot_nvstorage_test |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 1172 | |
Randall Spangler | 786acda | 2014-05-22 13:27:07 -0700 | [diff] [blame] | 1173 | .PHONY: run2tests |
| 1174 | run2tests: test_setup |
Randall Spangler | a7ab8b5 | 2014-06-10 17:05:08 -0700 | [diff] [blame] | 1175 | ${RUNTEST} ${BUILD_RUN}/tests/vb2_api_tests |
Randall Spangler | 786acda | 2014-05-22 13:27:07 -0700 | [diff] [blame] | 1176 | ${RUNTEST} ${BUILD_RUN}/tests/vb2_common_tests |
Randall Spangler | 7141d73 | 2014-05-15 15:34:54 -0700 | [diff] [blame] | 1177 | ${RUNTEST} ${BUILD_RUN}/tests/vb2_common2_tests ${TEST_KEYS} |
| 1178 | ${RUNTEST} ${BUILD_RUN}/tests/vb2_common3_tests ${TEST_KEYS} |
Randall Spangler | 3333e57 | 2014-05-14 11:37:52 -0700 | [diff] [blame] | 1179 | ${RUNTEST} ${BUILD_RUN}/tests/vb2_misc_tests |
Randall Spangler | 1803068 | 2014-06-11 16:01:08 -0700 | [diff] [blame] | 1180 | ${RUNTEST} ${BUILD_RUN}/tests/vb2_misc2_tests |
Randall Spangler | 3333e57 | 2014-05-14 11:37:52 -0700 | [diff] [blame] | 1181 | ${RUNTEST} ${BUILD_RUN}/tests/vb2_nvstorage_tests |
Randall Spangler | e166d04 | 2014-05-13 09:24:52 -0700 | [diff] [blame] | 1182 | ${RUNTEST} ${BUILD_RUN}/tests/vb2_rsa_utility_tests |
Randall Spangler | 3333e57 | 2014-05-14 11:37:52 -0700 | [diff] [blame] | 1183 | ${RUNTEST} ${BUILD_RUN}/tests/vb2_secdata_tests |
Randall Spangler | e166d04 | 2014-05-13 09:24:52 -0700 | [diff] [blame] | 1184 | ${RUNTEST} ${BUILD_RUN}/tests/vb2_sha_tests |
Randall Spangler | 786acda | 2014-05-22 13:27:07 -0700 | [diff] [blame] | 1185 | |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 1186 | .PHONY: runfutiltests |
Bill Richardson | feb2518 | 2013-03-07 12:54:29 -0800 | [diff] [blame] | 1187 | runfutiltests: override DESTDIR = ${TEST_INSTALL_DIR} |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 1188 | runfutiltests: test_setup install |
Bill Richardson | 339f7e0 | 2013-04-05 09:49:24 -0700 | [diff] [blame] | 1189 | tests/futility/run_test_scripts.sh ${DESTDIR} |
| 1190 | ${RUNTEST} ${BUILD_RUN}/tests/futility/test_not_really |
Randall Spangler | 844bce5 | 2013-01-15 16:16:43 -0800 | [diff] [blame] | 1191 | |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 1192 | # Run long tests, including all permutations of encryption keys (instead of |
Randall Spangler | 786a5dc | 2013-01-24 14:19:56 -0800 | [diff] [blame] | 1193 | # just the ones we use) and tests of currently-unused code. |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 1194 | # Not run by automated build. |
Bill Richardson | acb2ee9 | 2013-01-11 22:53:00 -0800 | [diff] [blame] | 1195 | .PHONY: runlongtests |
Bill Richardson | eecc18f | 2013-01-17 15:28:17 -0800 | [diff] [blame] | 1196 | runlongtests: test_setup genkeys genfuzztestcases |
Randall Spangler | e061a25 | 2013-01-22 15:34:07 -0800 | [diff] [blame] | 1197 | ${RUNTEST} ${BUILD_RUN}/tests/vboot_common2_tests ${TEST_KEYS} --all |
| 1198 | ${RUNTEST} ${BUILD_RUN}/tests/vboot_common3_tests ${TEST_KEYS} --all |
Randall Spangler | 7141d73 | 2014-05-15 15:34:54 -0700 | [diff] [blame] | 1199 | ifneq (${VBOOT2},) |
| 1200 | ${RUNTEST} ${BUILD_RUN}/tests/vb2_common2_tests ${TEST_KEYS} --all |
| 1201 | ${RUNTEST} ${BUILD_RUN}/tests/vb2_common3_tests ${TEST_KEYS} --all |
| 1202 | endif |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 1203 | tests/run_preamble_tests.sh --all |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame] | 1204 | tests/run_vbutil_tests.sh --all |
| 1205 | |
| 1206 | # TODO: tests to run when ported to new API |
| 1207 | # ./run_image_verification_tests.sh |
| 1208 | # # Splicing tests |
| 1209 | # ${BUILD}/tests/firmware_splicing_tests |
| 1210 | # ${BUILD}/tests/kernel_splicing_tests |
| 1211 | # # Rollback Tests |
| 1212 | # ${BUILD}/tests/firmware_rollback_tests |
| 1213 | # ${BUILD}/tests/kernel_rollback_tests |
| 1214 | |
Bill Richardson | 7829902 | 2014-06-20 14:33:00 -0700 | [diff] [blame] | 1215 | .PHONY: runalltests |
| 1216 | runalltests: runtests runfutiltests runlongtests |
| 1217 | |
Randall Spangler | 59d7508 | 2013-01-23 09:29:54 -0800 | [diff] [blame] | 1218 | # Code coverage |
| 1219 | .PHONY: coverage_init |
| 1220 | coverage_init: test_setup |
| 1221 | rm -f ${COV_INFO}* |
| 1222 | lcov -c -i -d . -b . -o ${COV_INFO}.initial |
| 1223 | |
| 1224 | .PHONY: coverage_html |
| 1225 | coverage_html: |
| 1226 | lcov -c -d . -b . -o ${COV_INFO}.tests |
| 1227 | lcov -a ${COV_INFO}.initial -a ${COV_INFO}.tests -o ${COV_INFO}.total |
| 1228 | lcov -r ${COV_INFO}.total '/usr/*' '*/linktest/*' -o ${COV_INFO}.local |
| 1229 | genhtml ${COV_INFO}.local -o ${BUILD}/coverage |
Bill Richardson | d2d08b2 | 2014-07-08 16:31:40 -0700 | [diff] [blame] | 1230 | # Generate addtional coverage stats just for firmware subdir, because the stats |
| 1231 | # for the whole project don't include subdirectory summaries. This will print |
| 1232 | # the summary for just the firmware sources. |
Randall Spangler | 49cb0d3 | 2013-01-29 14:28:16 -0800 | [diff] [blame] | 1233 | lcov -r ${COV_INFO}.local '*/stub/*' -o ${COV_INFO}.nostub |
| 1234 | lcov -e ${COV_INFO}.nostub '${SRCDIR}/firmware/*' \ |
Randall Spangler | 59d7508 | 2013-01-23 09:29:54 -0800 | [diff] [blame] | 1235 | -o ${COV_INFO}.firmware |
| 1236 | |
| 1237 | .PHONY: coverage |
| 1238 | ifeq (${COV},) |
| 1239 | coverage: |
| 1240 | $(error Build coverage like this: make clean && COV=1 make) |
| 1241 | else |
| 1242 | coverage: coverage_init runtests coverage_html |
| 1243 | endif |
Bill Richardson | 1912bba | 2013-04-04 21:08:50 -0700 | [diff] [blame] | 1244 | |
| 1245 | # Include generated dependencies |
| 1246 | ALL_DEPS += ${ALL_OBJS:%.o=%.o.d} |
| 1247 | -include ${ALL_DEPS} |