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 | |
Gabe Black | 0aedbe1 | 2012-12-20 00:26:59 -0800 | [diff] [blame] | 5 | ifneq ($(V),1) |
| 6 | Q := @ |
| 7 | endif |
| 8 | |
Simon Glass | 6d696e5 | 2011-11-14 13:46:33 -0800 | [diff] [blame] | 9 | # This Makefile normally builds in a 'build' subdir, but use |
| 10 | # |
| 11 | # make BUILD=<dir> |
| 12 | # |
| 13 | # to put the output somewhere else |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame^] | 14 | BUILD ?= $(shell pwd)/build |
Simon Glass | 6d696e5 | 2011-11-14 13:46:33 -0800 | [diff] [blame] | 15 | |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame^] | 16 | # Target for 'make install' |
| 17 | DESTDIR ?= /usr/bin |
| 18 | |
Simon Glass | b265c34 | 2011-11-16 15:09:51 -0800 | [diff] [blame] | 19 | # Provide default CC and CFLAGS for firmware builds; if you have any -D flags, |
| 20 | # please add them after this point (e.g., -DVBOOT_DEBUG). |
Che-Liang Chiou | 74359b7 | 2011-06-21 15:25:51 -0700 | [diff] [blame] | 21 | # |
Che-Liang Chiou | 6b0003c | 2011-10-14 11:11:28 +0800 | [diff] [blame] | 22 | # TODO(crosbug.com/16808) We hard-code u-boot's compiler flags here just |
| 23 | # temporarily. As we are still investigating which flags are necessary for |
| 24 | # maintaining a compatible ABI, etc. between u-boot and vboot_reference. |
Che-Liang Chiou | 74359b7 | 2011-06-21 15:25:51 -0700 | [diff] [blame] | 25 | # |
Simon Glass | b265c34 | 2011-11-16 15:09:51 -0800 | [diff] [blame] | 26 | # As a first step, this makes the setting of CC and CFLAGS here optional, to |
| 27 | # permit a calling script or Makefile to set these. |
Che-Liang Chiou | 74359b7 | 2011-06-21 15:25:51 -0700 | [diff] [blame] | 28 | # |
Simon Glass | b265c34 | 2011-11-16 15:09:51 -0800 | [diff] [blame] | 29 | # Flag ordering: arch, then -f, then -m, then -W |
| 30 | DEBUG_FLAGS := $(if ${DEBUG},-g -O0,-Os) |
| 31 | COMMON_FLAGS := -nostdinc -pipe \ |
| 32 | -ffreestanding -fno-builtin -fno-stack-protector \ |
| 33 | -Werror -Wall -Wstrict-prototypes $(DEBUG_FLAGS) |
| 34 | |
Che-Liang Chiou | 7604a7d | 2011-06-21 17:40:34 -0700 | [diff] [blame] | 35 | ifeq ($(FIRMWARE_ARCH), arm) |
Simon Glass | b265c34 | 2011-11-16 15:09:51 -0800 | [diff] [blame] | 36 | CC ?= armv7a-cros-linux-gnueabi-gcc |
| 37 | CFLAGS ?= -march=armv5 \ |
| 38 | -fno-common -ffixed-r8 \ |
Doug Anderson | d50b27d | 2012-05-11 12:08:02 -0700 | [diff] [blame] | 39 | -mfloat-abi=hard -marm -mabi=aapcs-linux -mno-thumb-interwork \ |
Simon Glass | b265c34 | 2011-11-16 15:09:51 -0800 | [diff] [blame] | 40 | $(COMMON_FLAGS) |
Che-Liang Chiou | 74359b7 | 2011-06-21 15:25:51 -0700 | [diff] [blame] | 41 | endif |
Che-Liang Chiou | 7604a7d | 2011-06-21 17:40:34 -0700 | [diff] [blame] | 42 | ifeq ($(FIRMWARE_ARCH), i386) |
Simon Glass | b265c34 | 2011-11-16 15:09:51 -0800 | [diff] [blame] | 43 | CC ?= i686-pc-linux-gnu-gcc |
| 44 | # Drop -march=i386 to permit use of SSE instructions |
| 45 | CFLAGS ?= \ |
| 46 | -ffunction-sections -fvisibility=hidden -fno-strict-aliasing \ |
| 47 | -fomit-frame-pointer -fno-toplevel-reorder -fno-dwarf2-cfi-asm \ |
| 48 | -mpreferred-stack-boundary=2 -mregparm=3 \ |
| 49 | $(COMMON_FLAGS) |
Che-Liang Chiou | 34be827 | 2011-01-27 16:44:36 +0800 | [diff] [blame] | 50 | endif |
Simon Glass | 8e85e98 | 2011-11-22 13:54:50 -0800 | [diff] [blame] | 51 | ifeq ($(FIRMWARE_ARCH), x86_64) |
| 52 | CFLAGS ?= $(COMMON_FLAGS) \ |
| 53 | -fvisibility=hidden -fno-strict-aliasing -fomit-frame-pointer |
| 54 | endif |
Che-Liang Chiou | 34be827 | 2011-01-27 16:44:36 +0800 | [diff] [blame] | 55 | |
Randall Spangler | 287beae | 2011-04-11 12:46:40 -0700 | [diff] [blame] | 56 | # Fix compiling directly on host (outside of emake) |
| 57 | ifeq ($(ARCH),) |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame^] | 58 | ARCH = amd64 |
Randall Spangler | 287beae | 2011-04-11 12:46:40 -0700 | [diff] [blame] | 59 | endif |
| 60 | |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame^] | 61 | # Some things only compile inside the Chromium OS chroot |
| 62 | # TODO: is there a better way to detect this? |
| 63 | ifneq ($(CROS_WORKON_SRCROOT),) |
| 64 | IN_CHROOT = 1 |
| 65 | endif |
| 66 | |
| 67 | CC ?= gcc |
| 68 | CXX ?= g++ |
| 69 | LD = $(CC) |
| 70 | PKG_CONFIG ?= pkg-config |
| 71 | |
Che-Liang Chiou | 34be827 | 2011-01-27 16:44:36 +0800 | [diff] [blame] | 72 | ifeq ($(FIRMWARE_ARCH),) |
Bill Richardson | f472919 | 2012-05-02 23:30:16 -0700 | [diff] [blame] | 73 | CFLAGS += -DCHROMEOS_ENVIRONMENT -Wall -Werror |
Che-Liang Chiou | 34be827 | 2011-01-27 16:44:36 +0800 | [diff] [blame] | 74 | endif |
| 75 | |
| 76 | ifneq (${DEBUG},) |
| 77 | CFLAGS += -DVBOOT_DEBUG |
vbendeb | b2b0fcc | 2010-07-15 15:09:47 -0700 | [diff] [blame] | 78 | endif |
Che-Liang Chiou | 0a0e8d0 | 2010-11-30 09:30:45 +0800 | [diff] [blame] | 79 | |
vbendeb | b2b0fcc | 2010-07-15 15:09:47 -0700 | [diff] [blame] | 80 | ifeq (${DISABLE_NDEBUG},) |
| 81 | CFLAGS += -DNDEBUG |
| 82 | endif |
| 83 | |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame^] | 84 | # Create / use dependency files |
| 85 | CFLAGS += -MMD -MF $@.d |
Simon Glass | b265c34 | 2011-11-16 15:09:51 -0800 | [diff] [blame] | 86 | |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame^] | 87 | # Code coverage |
| 88 | ifneq (${COV},) |
| 89 | #COV_FLAGS = -O0 -fprofile-arcs -ftest-coverage |
| 90 | COV_FLAGS = -O0 --coverage |
| 91 | CFLAGS += $(COV_FLAGS) |
| 92 | LDFLAGS += $(COV_FLAGS) |
Che-Liang Chiou | 0a0e8d0 | 2010-11-30 09:30:45 +0800 | [diff] [blame] | 93 | endif |
Gaurav Shah | 322536d | 2010-01-28 15:01:23 -0800 | [diff] [blame] | 94 | |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame^] | 95 | INCLUDES += \ |
| 96 | -Ifirmware/include \ |
| 97 | -Ifirmware/lib/include \ |
| 98 | -Ifirmware/lib/cgptlib/include \ |
| 99 | -Ifirmware/lib/cryptolib/include \ |
| 100 | -Ifirmware/lib/tpm_lite/include |
Bill Richardson | 0b8f35c | 2010-05-26 09:18:38 -0700 | [diff] [blame] | 101 | |
Che-Liang Chiou | 0a0e8d0 | 2010-11-30 09:30:45 +0800 | [diff] [blame] | 102 | ifeq ($(FIRMWARE_ARCH),) |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame^] | 103 | INCLUDES += -Ifirmware/stub/include |
Che-Liang Chiou | 0a0e8d0 | 2010-11-30 09:30:45 +0800 | [diff] [blame] | 104 | else |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame^] | 105 | INCLUDES += -Ifirmware/arch/$(FIRMWARE_ARCH)/include |
Che-Liang Chiou | 0a0e8d0 | 2010-11-30 09:30:45 +0800 | [diff] [blame] | 106 | endif |
Gaurav Shah | 322536d | 2010-01-28 15:01:23 -0800 | [diff] [blame] | 107 | |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame^] | 108 | # Output libraries |
| 109 | CGPTLIB := ${BUILD}/cgpt/libcgpt-cc.a |
| 110 | DUMPKERNELCONFIGLIB := ${BUILD}/libdump_kernel_config.a |
| 111 | FWLIB := ${BUILD}/vboot_fw.a |
| 112 | HOSTLIB := ${BUILD}/vboot_host.a |
| 113 | TEST_LIB := ${BUILD}/tests/test.a |
Gaurav Shah | 322536d | 2010-01-28 15:01:23 -0800 | [diff] [blame] | 114 | |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame^] | 115 | CRYPTO_LIBS := $(shell $(PKG_CONFIG) --libs libcrypto) |
Jay Srinivasan | 5fac757 | 2012-02-23 10:59:01 -0800 | [diff] [blame] | 116 | |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame^] | 117 | ifneq ($(IN_CHROOT),) |
| 118 | PC_BASE_VER ?= 125070 |
| 119 | PC_DEPS = libchrome-$(PC_BASE_VER) |
| 120 | PC_CFLAGS := $(shell $(PKG_CONFIG) --cflags $(PC_DEPS)) |
| 121 | PC_LDLIBS := $(shell $(PKG_CONFIG) --libs $(PC_DEPS)) |
| 122 | endif |
Jay Srinivasan | 5fac757 | 2012-02-23 10:59:01 -0800 | [diff] [blame] | 123 | |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame^] | 124 | # Link with hostlib and crypto libs by default |
| 125 | LIBS = $(HOSTLIB) |
| 126 | LDLIBS = $(CRYPTO_LIBS) |
| 127 | |
| 128 | # Create output directories if necessary. Do this via explicit shell commands |
| 129 | # so it happens before trying to generate/include dependencies. |
| 130 | SUBDIRS := firmware host utility cgpt tests tests/tpm_lite |
| 131 | _dir_create := $(foreach d, \ |
| 132 | $(shell find $(SUBDIRS) -name '*.c' -exec dirname {} \; | sort -u), \ |
| 133 | $(shell [ -d $(BUILD)/$(d) ] || mkdir -p $(BUILD)/$(d))) |
| 134 | |
| 135 | # First target |
| 136 | all: fwlib $(if $(FIRMWARE_ARCH),,host_stuff) |
| 137 | |
| 138 | # Host targets |
| 139 | host_stuff: fwlib hostlib cgpt utils tests |
Jay Srinivasan | 250549d | 2012-02-16 17:40:45 -0800 | [diff] [blame] | 140 | |
Gaurav Shah | 322536d | 2010-01-28 15:01:23 -0800 | [diff] [blame] | 141 | clean: |
Gabe Black | 0aedbe1 | 2012-12-20 00:26:59 -0800 | [diff] [blame] | 142 | $(Q)/bin/rm -rf ${BUILD} |
Bill Richardson | 371df8b | 2010-05-27 14:19:47 -0700 | [diff] [blame] | 143 | |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame^] | 144 | install: cgpt_install utils_install |
Gaurav Shah | e642198 | 2010-06-03 07:49:32 -0700 | [diff] [blame] | 145 | |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame^] | 146 | # Coverage |
| 147 | COV_INFO = $(BUILD)/coverage.info |
| 148 | #coverage: runtests |
| 149 | coverage: |
| 150 | rm -f $(COV_INFO)* |
| 151 | lcov --capture --directory . --base-directory . -o $(COV_INFO).1 |
| 152 | lcov --remove $(COV_INFO).1 '/usr/*' -o $(COV_INFO) |
| 153 | genhtml $(COV_INFO) --output-directory $(BUILD)/coverage |
Luigi Semenzato | 18b814d | 2010-07-08 17:17:02 -0700 | [diff] [blame] | 154 | |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame^] | 155 | # Don't delete intermediate object files |
| 156 | .SECONDARY: |
Randall Spangler | e8cfa31 | 2013-01-02 16:49:38 -0800 | [diff] [blame] | 157 | |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame^] | 158 | # Use second expansion phase for $$(LIBS) so dependencies on libraries are |
| 159 | # properly evaluated for implicit rules. |
| 160 | .SECONDEXPANSION: |
Jay Srinivasan | 250549d | 2012-02-16 17:40:45 -0800 | [diff] [blame] | 161 | |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame^] | 162 | # ----------------------------------------------------------------------------- |
| 163 | # Firmware library |
Bill Richardson | 856e072 | 2011-02-07 15:39:45 -0800 | [diff] [blame] | 164 | |
Randall Spangler | 5d9bbf2 | 2013-01-08 10:44:23 -0800 | [diff] [blame^] | 165 | # TPM-specific flags. These depend on the particular TPM we're targeting for. |
| 166 | # They are needed here only for compiling parts of the firmware code into |
| 167 | # user-level tests. |
| 168 | |
| 169 | # TPM_BLOCKING_CONTINUESELFTEST is defined if TPM_ContinueSelfTest blocks until |
| 170 | # the self test has completed. |
| 171 | |
| 172 | $(FWLIB) : CFLAGS += -DTPM_BLOCKING_CONTINUESELFTEST |
| 173 | |
| 174 | # TPM_MANUAL_SELFTEST is defined if the self test must be started manually |
| 175 | # (with a call to TPM_ContinueSelfTest) instead of starting automatically at |
| 176 | # power on. |
| 177 | # |
| 178 | # We sincerely hope that TPM_BLOCKING_CONTINUESELFTEST and TPM_MANUAL_SELFTEST |
| 179 | # are not both defined at the same time. (See comment in code.) |
| 180 | |
| 181 | # CFLAGS += -DTPM_MANUAL_SELFTEST |
| 182 | |
| 183 | ifeq ($(FIRMWARE_ARCH),i386) |
| 184 | # Unrolling loops in cryptolib makes it faster |
| 185 | $(FWLIB) : CFLAGS += -DUNROLL_LOOPS |
| 186 | |
| 187 | # Workaround for coreboot on x86, which will power off asynchronously |
| 188 | # without giving us a chance to react. This is not an example of the Right |
| 189 | # Way to do things. See chrome-os-partner:7689, and the commit message |
| 190 | # that made this change. |
| 191 | $(FWLIB) : CFLAGS += -DSAVE_LOCALE_IMMEDIATELY |
| 192 | |
| 193 | # On x86 we don't actually read the GBB data into RAM until it is needed. |
| 194 | # Therefore it makes sense to cache it rather than reading it each time. |
| 195 | # Enable this feature. |
| 196 | $(FWLIB) : CFLAGS += -DCOPY_BMP_DATA |
| 197 | endif |
| 198 | |
| 199 | ifeq ($(FIRMWARE_ARCH),) |
| 200 | $(warning FIRMWARE_ARCH not defined; assuming local compile) |
| 201 | |
| 202 | # Disable rollback TPM when compiling locally, since otherwise |
| 203 | # load_kernel_test attempts to talk to the TPM. |
| 204 | $(FWLIB) : CFLAGS += -DDISABLE_ROLLBACK_TPM |
| 205 | endif |
| 206 | |
| 207 | # find lib -iname '*.c' | sort |
| 208 | FWLIB_SRCS = \ |
| 209 | firmware/lib/cgptlib/cgptlib.c \ |
| 210 | firmware/lib/cgptlib/cgptlib_internal.c \ |
| 211 | firmware/lib/cgptlib/crc32.c \ |
| 212 | firmware/lib/crc8.c \ |
| 213 | firmware/lib/cryptolib/padding.c \ |
| 214 | firmware/lib/cryptolib/rsa.c \ |
| 215 | firmware/lib/cryptolib/rsa_utility.c \ |
| 216 | firmware/lib/cryptolib/sha1.c \ |
| 217 | firmware/lib/cryptolib/sha256.c \ |
| 218 | firmware/lib/cryptolib/sha512.c \ |
| 219 | firmware/lib/cryptolib/sha_utility.c \ |
| 220 | firmware/lib/stateful_util.c \ |
| 221 | firmware/lib/utility.c \ |
| 222 | firmware/lib/utility_string.c \ |
| 223 | firmware/lib/vboot_api_init.c \ |
| 224 | firmware/lib/vboot_api_firmware.c \ |
| 225 | firmware/lib/vboot_api_kernel.c \ |
| 226 | firmware/lib/vboot_audio.c \ |
| 227 | firmware/lib/vboot_common.c \ |
| 228 | firmware/lib/vboot_display.c \ |
| 229 | firmware/lib/vboot_firmware.c \ |
| 230 | firmware/lib/vboot_kernel.c \ |
| 231 | firmware/lib/vboot_nvstorage.c |
| 232 | |
| 233 | ifeq ($(MOCK_TPM),) |
| 234 | FWLIB_SRCS += \ |
| 235 | firmware/lib/rollback_index.c \ |
| 236 | firmware/lib/tpm_bootmode.c \ |
| 237 | firmware/lib/tpm_lite/tlcl.c |
| 238 | else |
| 239 | FWLIB_SRCS += \ |
| 240 | firmware/lib/mocked_rollback_index.c \ |
| 241 | firmware/lib/mocked_tpm_bootmode.c \ |
| 242 | firmware/lib/tpm_lite/mocked_tlcl.c |
| 243 | endif |
| 244 | |
| 245 | ifeq ($(FIRMWARE_ARCH),) |
| 246 | # Include stub into firmware lib if compiling for host |
| 247 | FWLIB_SRCS += \ |
| 248 | firmware/stub/tpm_lite_stub.c \ |
| 249 | firmware/stub/utility_stub.c \ |
| 250 | firmware/stub/vboot_api_stub.c \ |
| 251 | firmware/stub/vboot_api_stub_disk.c |
| 252 | endif |
| 253 | |
| 254 | FWLIB_OBJS = $(FWLIB_SRCS:%.c=${BUILD}/%.o) |
| 255 | ALL_OBJS += ${FWLIB_OBJS} |
| 256 | |
| 257 | ifeq ($(FIRMWARE_ARCH),) |
| 258 | # Link test ensures firmware lib doesn't rely on outside libraries |
| 259 | ${BUILD}/firmware/linktest/main : LIBS = $(FWLIB) |
| 260 | |
| 261 | fwlib : ${BUILD}/firmware/linktest/main |
| 262 | else |
| 263 | fwlib : $(FWLIB) |
| 264 | endif |
| 265 | |
| 266 | $(FWLIB) : $(FWLIB_OBJS) |
| 267 | @printf " RM $(subst $(BUILD)/,,$(@))\n" |
| 268 | $(Q)rm -f $@ |
| 269 | @printf " AR $(subst $(BUILD)/,,$(@))\n" |
| 270 | $(Q)ar qc $@ $^ |
| 271 | |
| 272 | # ----------------------------------------------------------------------------- |
| 273 | # Host library |
| 274 | |
| 275 | hostlib : $(HOSTLIB) ${BUILD}/host/linktest/main |
| 276 | |
| 277 | ${BUILD}/host/% ${HOSTLIB} : INCLUDES += \ |
| 278 | -Ihost/include\ |
| 279 | -Ihost/arch/$(ARCH)/include |
| 280 | |
| 281 | HOSTLIB_SRCS = \ |
| 282 | host/arch/$(ARCH)/lib/crossystem_arch.c \ |
| 283 | host/lib/crossystem.c \ |
| 284 | host/lib/file_keys.c \ |
| 285 | host/lib/fmap.c \ |
| 286 | host/lib/host_common.c \ |
| 287 | host/lib/host_key.c \ |
| 288 | host/lib/host_keyblock.c \ |
| 289 | host/lib/host_misc.c \ |
| 290 | host/lib/host_signature.c \ |
| 291 | host/lib/signature_digest.c |
| 292 | |
| 293 | HOSTLIB_OBJS = $(HOSTLIB_SRCS:%.c=${BUILD}/%.o) |
| 294 | ALL_OBJS += ${HOSTLIB_OBJS} |
| 295 | |
| 296 | # TODO: better way to make .a than duplicating this recipe each time? |
| 297 | $(HOSTLIB) : $(HOSTLIB_OBJS) $(FWLIB_OBJS) |
| 298 | @printf " RM $(subst $(BUILD)/,,$(@))\n" |
| 299 | $(Q)rm -f $@ |
| 300 | @printf " AR $(subst $(BUILD)/,,$(@))\n" |
| 301 | $(Q)ar qc $@ $^ |
| 302 | |
| 303 | # ----------------------------------------------------------------------------- |
| 304 | # CGPT library and utility |
| 305 | |
| 306 | CGPT = ${BUILD}/cgpt/cgpt |
| 307 | |
| 308 | CGPT_SRCS = \ |
| 309 | cgpt/cgpt.c \ |
| 310 | cgpt/cgpt_add.c \ |
| 311 | cgpt/cgpt_boot.c \ |
| 312 | cgpt/cgpt_common.c \ |
| 313 | cgpt/cgpt_create.c \ |
| 314 | cgpt/cgpt_find.c \ |
| 315 | cgpt/cgpt_legacy.c \ |
| 316 | cgpt/cgpt_prioritize.c \ |
| 317 | cgpt/cgpt_repair.c \ |
| 318 | cgpt/cgpt_show.c \ |
| 319 | cgpt/cmd_add.c \ |
| 320 | cgpt/cmd_boot.c \ |
| 321 | cgpt/cmd_create.c \ |
| 322 | cgpt/cmd_find.c \ |
| 323 | cgpt/cmd_legacy.c \ |
| 324 | cgpt/cmd_prioritize.c \ |
| 325 | cgpt/cmd_repair.c \ |
| 326 | cgpt/cmd_show.c |
| 327 | |
| 328 | CGPT_OBJS = $(CGPT_SRCS:%.c=${BUILD}/%.o) |
| 329 | ALL_OBJS += ${CGPT_OBJS} |
| 330 | |
| 331 | # TODO: why not make this include *all* the cgpt files, and simply have |
| 332 | # cgpt link against it? |
| 333 | # TODO: CgptManager.cc should move to the installer project. Shouldn't be |
| 334 | # in libcgpt-cc.a. |
| 335 | CGPTLIB_SRCS = \ |
| 336 | cgpt/CgptManager.cc \ |
| 337 | cgpt/cgpt_create.c \ |
| 338 | cgpt/cgpt_add.c \ |
| 339 | cgpt/cgpt_boot.c \ |
| 340 | cgpt/cgpt_show.c \ |
| 341 | cgpt/cgpt_repair.c \ |
| 342 | cgpt/cgpt_prioritize.c \ |
| 343 | cgpt/cgpt_common.c \ |
| 344 | firmware/lib/cgptlib/crc32.c \ |
| 345 | firmware/lib/cgptlib/cgptlib_internal.c \ |
| 346 | firmware/stub/utility_stub.c |
| 347 | |
| 348 | CGPTLIB_OBJS = $(filter %.o, \ |
| 349 | $(CGPTLIB_SRCS:%.c=${BUILD}/%.o) \ |
| 350 | $(CGPTLIB_SRCS:%.cc=${BUILD}/%.o)) |
| 351 | ALL_OBJS += $(CGPTLIB_OBJS) |
| 352 | |
| 353 | cgpt : $(CGPT) |
| 354 | .PHONY: cgpt |
| 355 | |
| 356 | libcgpt_cc : $(CGPTLIB) |
| 357 | |
| 358 | $(CGPTLIB) : INCLUDES += -Ifirmware/lib/cgptlib/include |
| 359 | $(CGPTLIB) : $(CGPTLIB_OBJS) |
| 360 | @printf " RM $(subst $(BUILD)/,,$(@))\n" |
| 361 | $(Q)rm -f $@ |
| 362 | @printf " AR $(subst $(BUILD)/,,$(@))\n" |
| 363 | $(Q)ar qc $@ $^ |
| 364 | |
| 365 | $(CGPT) : INCLUDES += -Ifirmware/lib/cgptlib/include |
| 366 | $(CGPT) : LDLIBS = -luuid |
| 367 | $(CGPT) : LDFLAGS += -static |
| 368 | $(CGPT) : $(CGPT_OBJS) $$(LIBS) |
| 369 | @printf " LDcgpt $(subst $(BUILD)/,,$(@))\n" |
| 370 | $(Q)$(LD) -o $(CGPT) $(CFLAGS) $(LDFLAGS) $^ $(LIBS) $(LDLIBS) |
| 371 | |
| 372 | cgpt_install: $(CGPT) |
| 373 | mkdir -p $(DESTDIR) |
| 374 | cp -f $^ $(DESTDIR) |
| 375 | chmod a+rx $(patsubst ${BUILD}/cgpt/%,$(DESTDIR)/%,$^) |
| 376 | |
| 377 | # ----------------------------------------------------------------------------- |
| 378 | # Utilities |
| 379 | |
| 380 | ${BUILD}/utility/% : INCLUDES += -Ihost/include -Iutility/include |
| 381 | ${BUILD}/utility/% : CFLAGS += $(PC_CFLAGS) |
| 382 | |
| 383 | AU_NAMES = \ |
| 384 | crossystem \ |
| 385 | dump_fmap \ |
| 386 | gbb_utility |
| 387 | AU_BINS := $(addprefix ${BUILD}/utility/,$(AU_NAMES)) |
| 388 | |
| 389 | # Utilities for auto-update toolkits must be statically linked, and don't |
| 390 | # use the crypto libs. |
| 391 | ${AU_BINS} : LDFLAGS += -static |
| 392 | ${AU_BINS} : CRYPTO_LIBS = |
| 393 | |
| 394 | # Scripts to install |
| 395 | UTIL_SCRIPTS = \ |
| 396 | utility/dev_debug_vboot \ |
| 397 | utility/dev_make_keypair \ |
| 398 | utility/enable_dev_usb_boot \ |
| 399 | utility/vbutil_what_keys |
| 400 | |
| 401 | UTIL_NAMES = $(AU_NAMES) \ |
| 402 | dev_sign_file \ |
| 403 | dump_kernel_config \ |
| 404 | dumpRSAPublicKey \ |
| 405 | load_kernel_test \ |
| 406 | pad_digest_utility \ |
| 407 | signature_digest_utility \ |
| 408 | tpm_init_temp_fix \ |
| 409 | tpmc \ |
| 410 | vbutil_ec \ |
| 411 | vbutil_firmware \ |
| 412 | vbutil_kernel \ |
| 413 | vbutil_key \ |
| 414 | vbutil_keyblock \ |
| 415 | verify_data |
| 416 | |
| 417 | ifneq ($(IN_CHROOT),) |
| 418 | UTIL_NAMES += mount-encrypted |
| 419 | endif |
| 420 | |
| 421 | ifeq ($(MINIMAL),) |
| 422 | UTIL_NAMES += \ |
| 423 | bmpblk_font \ |
| 424 | bmpblk_utility \ |
| 425 | eficompress \ |
| 426 | efidecompress |
| 427 | endif |
| 428 | |
| 429 | UTIL_BINS = $(addprefix ${BUILD}/utility/,$(UTIL_NAMES)) |
| 430 | ALL_DEPS += $(addsuffix .d,${UTIL_BINS}) |
| 431 | |
| 432 | utils : $(UTIL_BINS) $(UTIL_SCRIPTS) |
| 433 | # TODO: change ebuild to pull scripts directly out of utility dir |
| 434 | $(Q)cp -f $(UTIL_SCRIPTS) $(BUILD)/utility |
| 435 | $(Q)chmod a+rx $(patsubst %,$(BUILD)/%,$(UTIL_SCRIPTS)) |
| 436 | |
| 437 | utils_install : $(UTIL_BINS) $(UTIL_SCRIPTS) |
| 438 | mkdir -p $(DESTDIR) |
| 439 | cp -f $(UTIL_BINS) $(DESTDIR) |
| 440 | chmod a+rx $(patsubst %,$(DESTDIR)/%,$(UTIL_NAMES)) |
| 441 | cp -f $(UTIL_SCRIPTS) $(DESTDIR) |
| 442 | chmod a+rx $(patsubst utility/%,$(DESTDIR)/%,$(UTIL_SCRIPTS)) |
| 443 | |
| 444 | ${BUILD}/utility/dump_kernel_config : LIBS += $(DUMPKERNELCONFIGLIB) |
| 445 | ${BUILD}/utility/dump_kernel_config : $$(LIBS) \ |
| 446 | ${BUILD}/utility/dump_kernel_config_main.o |
| 447 | @printf " LDdkc $(subst $(BUILD)/,,$(@))\n" |
| 448 | $(Q)$(LD) $(CFLAGS) $(LDFLAGS) $^ -o $@ $(LIBS) |
| 449 | |
| 450 | # TODO: these build as both standalone utils and libs. Make standalone the |
| 451 | # default so this is less crufty. |
| 452 | ${BUILD}/utility/eficompress.o : CFLAGS += -DSTANDALONE |
| 453 | ${BUILD}/utility/efidecompress.o : CFLAGS += -DSTANDALONE |
| 454 | |
| 455 | ${BUILD}/utility/eficompress_lib.o : utility/eficompress.c |
| 456 | @printf " CC $(subst $(BUILD)/,,$(@))\n" |
| 457 | $(Q)$(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $< |
| 458 | ${BUILD}/utility/efidecompress_lib.o : utility/efidecompress.c |
| 459 | @printf " CC $(subst $(BUILD)/,,$(@))\n" |
| 460 | $(Q)$(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $< |
| 461 | |
| 462 | # GBB utility needs C++ linker |
| 463 | ${BUILD}/utility/gbb_utility : LD = $(CXX) |
| 464 | ${BUILD}/utility/gbb_utility : CFLAGS += -DWITH_UTIL_MAIN |
| 465 | |
| 466 | ${BUILD}/utility/crossystem : ${BUILD}/utility/crossystem_main.o $$(LIBS) |
| 467 | @printf " LDcr $(subst $(BUILD)/,,$(@))\n" |
| 468 | $(Q)$(LD) $(CFLAGS) $(LDFLAGS) $< -o $@ $(LIBS) $(LDLIBS) |
| 469 | |
| 470 | # TODO: Why isn't this the default? It's the only time this file is compiled. |
| 471 | # (gbb_utility, too) |
| 472 | ${BUILD}/utility/bmpblk_utility.o : CFLAGS += -DWITH_UTIL_MAIN |
| 473 | |
| 474 | ${BUILD}/utility/bmpblk_utility : LD = $(CXX) |
| 475 | ${BUILD}/utility/bmpblk_utility : LDLIBS = -llzma -lyaml |
| 476 | ${BUILD}/utility/bmpblk_utility : OBJS = \ |
| 477 | ${BUILD}/utility/bmpblk_util.o \ |
| 478 | ${BUILD}/utility/image_types.o \ |
| 479 | ${BUILD}/utility/eficompress_lib.o \ |
| 480 | ${BUILD}/utility/efidecompress_lib.o |
| 481 | |
| 482 | ${BUILD}/utility/bmpblk_font: OBJS += ${BUILD}/utility/image_types.o |
| 483 | |
| 484 | # TODO: fix load_firmware_test util; it never got refactored for the new APIs |
| 485 | |
| 486 | # ----------------------------------------------------------------------------- |
| 487 | # Mount-encrypted utility for cryptohome |
| 488 | |
| 489 | # TODO: mount-encrypted should move to cryptohome and just link against |
| 490 | # vboot-host.a for tlcl and crossystem. |
| 491 | |
| 492 | # The embedded libcrypto conflicts with the shipped openssl, |
| 493 | # so mount-* builds without the common CFLAGS (and those includes). |
| 494 | |
| 495 | ${BUILD}/utility/mount-helpers.o: \ |
| 496 | utility/mount-helpers.c \ |
| 497 | utility/mount-helpers.h \ |
| 498 | utility/mount-encrypted.h |
| 499 | @printf " CCm-e $(subst $(BUILD)/,,$(@))\n" |
| 500 | $(Q)$(CC) -Wall -Werror -O2 -D_FORTIFY_SOURCE=2 -fstack-protector \ |
| 501 | $(COV_FLAGS) \ |
| 502 | $(shell $(PKG_CONFIG) --cflags glib-2.0 openssl) \ |
| 503 | -c $< -o $@ |
| 504 | |
| 505 | ${BUILD}/utility/mount-encrypted: \ |
| 506 | utility/mount-encrypted.c \ |
| 507 | utility/mount-encrypted.h \ |
| 508 | ${BUILD}/utility/mount-helpers.o $$(LIBS) |
| 509 | @printf " CCm-exe $(subst $(BUILD)/,,$(@))\n" |
| 510 | $(Q)$(CC) -Wall -Werror -O2 -D_FORTIFY_SOURCE=2 -fstack-protector \ |
| 511 | $(shell $(PKG_CONFIG) --cflags glib-2.0 openssl) \ |
| 512 | -Ifirmware/include \ |
| 513 | -Ihost/include \ |
| 514 | $(COV_FLAGS) \ |
| 515 | $(LDFLAGS) \ |
| 516 | $< -o $@ \ |
| 517 | ${BUILD}/utility/mount-helpers.o $(LIBS) \ |
| 518 | $(shell $(PKG_CONFIG) --libs glib-2.0 openssl) \ |
| 519 | -lm |
| 520 | ifneq (${COV},) |
| 521 | $(Q)mv -f mount-encrypted.gcno ${BUILD}/utility |
| 522 | endif |
| 523 | |
| 524 | # ----------------------------------------------------------------------------- |
| 525 | # Utility to generate TLCL structure definition header file. |
| 526 | |
| 527 | ${BUILD}/utility/tlcl_generator : CFLAGS += -fpack-struct |
| 528 | ${BUILD}/utility/tlcl_generator : LIBS = |
| 529 | |
| 530 | STRUCTURES_TMP=${BUILD}/tlcl_structures.tmp |
| 531 | STRUCTURES_SRC=firmware/lib/tpm_lite/include/tlcl_structures.h |
| 532 | |
| 533 | update_tlcl_structures: ${BUILD}/utility/tlcl_generator |
| 534 | @printf " Rebuilding TLCL structures\n" |
| 535 | $(Q)${BUILD}/utility/tlcl_generator > $(STRUCTURES_TMP) |
| 536 | $(Q)cmp -s $(STRUCTURES_TMP) $(STRUCTURES_SRC) || \ |
| 537 | ( echo "%% Updating structures.h %%" && \ |
| 538 | cp $(STRUCTURES_TMP) $(STRUCTURES_SRC) ) |
| 539 | |
| 540 | # ----------------------------------------------------------------------------- |
| 541 | # Library to dump kernel config |
| 542 | |
| 543 | libdump_kernel_config: $(DUMPKERNELCONFIGLIB) |
| 544 | |
| 545 | $(DUMPKERNELCONFIGLIB) : ${BUILD}/utility/dump_kernel_config.o |
| 546 | @printf " RM $(subst $(BUILD)/,,$(@))\n" |
| 547 | $(Q)rm -f $@ |
| 548 | @printf " AR $(subst $(BUILD)/,,$(@))\n" |
| 549 | $(Q)ar qc $@ $^ |
| 550 | |
| 551 | # ----------------------------------------------------------------------------- |
| 552 | # Tests |
| 553 | |
| 554 | # Allow multiple definitions, so tests can mock functions from other libraries |
| 555 | ${BUILD}/tests/% : CFLAGS += -Xlinker --allow-multiple-definition |
| 556 | ${BUILD}/tests/% : INCLUDES += -Ihost/include |
| 557 | ${BUILD}/tests/% : LDLIBS += -lrt -luuid |
| 558 | ${BUILD}/tests/% : LIBS += $(TEST_LIB) |
| 559 | |
| 560 | TEST_NAMES = \ |
| 561 | cgptlib_test \ |
| 562 | rollback_index2_tests \ |
| 563 | rsa_padding_test \ |
| 564 | rsa_utility_tests \ |
| 565 | rsa_verify_benchmark \ |
| 566 | sha_benchmark \ |
| 567 | sha_tests \ |
| 568 | stateful_util_tests \ |
| 569 | tpm_bootmode_tests \ |
| 570 | utility_string_tests \ |
| 571 | utility_tests \ |
| 572 | vboot_nvstorage_test \ |
| 573 | vboot_api_init_tests \ |
| 574 | vboot_api_devmode_tests \ |
| 575 | vboot_api_firmware_tests \ |
| 576 | vboot_api_kernel_tests \ |
| 577 | vboot_audio_tests \ |
| 578 | vboot_common_tests \ |
| 579 | vboot_common2_tests \ |
| 580 | vboot_common3_tests \ |
| 581 | vboot_ec_tests \ |
| 582 | vboot_firmware_tests |
| 583 | |
| 584 | ifneq ($(IN_CHROOT),) |
| 585 | TEST_NAMES += CgptManagerTests |
| 586 | endif |
| 587 | |
| 588 | TLCL_TEST_NAMES = \ |
| 589 | earlyextend \ |
| 590 | earlynvram \ |
| 591 | earlynvram2 \ |
| 592 | enable \ |
| 593 | fastenable \ |
| 594 | globallock \ |
| 595 | redefine_unowned \ |
| 596 | spaceperm \ |
| 597 | testsetup \ |
| 598 | timing \ |
| 599 | writelimit |
| 600 | TEST_NAMES += $(addprefix tpm_lite/tpmtest_,$(TLCL_TEST_NAMES)) |
| 601 | |
| 602 | TEST_BINS = $(addprefix ${BUILD}/tests/,$(TEST_NAMES)) |
| 603 | ALL_DEPS += $(addsuffix .d,${TEST_BINS}) |
| 604 | |
| 605 | tests : $(TEST_BINS) |
| 606 | |
| 607 | ${TEST_LIB}: \ |
| 608 | ${BUILD}/tests/test_common.o \ |
| 609 | ${BUILD}/tests/timer_utils.o \ |
| 610 | ${BUILD}/tests/crc32_test.o |
| 611 | @printf " RM $(subst $(BUILD)/,,$(@))\n" |
| 612 | $(Q)rm -f $@ |
| 613 | @printf " AR $(subst $(BUILD)/,,$(@))\n" |
| 614 | $(Q)ar qc $@ $^ |
| 615 | |
| 616 | # Compile rollback_index.c for unit test, so it uses the same implementation |
| 617 | # as it does in the firmware. |
| 618 | ${BUILD}/tests/rollback_index_for_test.o : CFLAGS += -DROLLBACK_UNITTEST |
| 619 | ${BUILD}/tests/rollback_index_for_test.o : firmware/lib/rollback_index.c |
| 620 | @printf " CC $(subst $(BUILD)/,,$(@))\n" |
| 621 | $(Q)$(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $< |
| 622 | |
| 623 | ${BUILD}/tests/rollback_index2_tests: OBJS += \ |
| 624 | ${BUILD}/tests/rollback_index_for_test.o |
| 625 | |
| 626 | ${BUILD}/tests/vboot_audio_for_test.o : CFLAGS += -DCUSTOM_MUSIC |
| 627 | ${BUILD}/tests/vboot_audio_for_test.o : firmware/lib/vboot_audio.c |
| 628 | @printf " CC $(subst $(BUILD)/,,$(@))\n" |
| 629 | $(Q)$(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $< |
| 630 | |
| 631 | ${BUILD}/tests/vboot_audio_tests: OBJS += \ |
| 632 | ${BUILD}/tests/vboot_audio_for_test.o \ |
| 633 | |
| 634 | cgptmanager_tests: ${BUILD}/tests/CgptManagerTests |
| 635 | |
| 636 | ${BUILD}/tests/CgptManagerTests : CFLAGS += -DWITH_UTIL_MAIN $(PC_CFLAGS) |
| 637 | ${BUILD}/tests/CgptManagerTests : LD = $(CXX) |
| 638 | ${BUILD}/tests/CgptManagerTests : LDLIBS += -lgtest -lgflags $(PC_LDLIBS) |
| 639 | ${BUILD}/tests/CgptManagerTests : LIBS = $(CGPTLIB) |
| 640 | |
| 641 | ${BUILD}/tests/rollback_index_test.o : INCLUDES += -I/usr/include |
| 642 | ${BUILD}/tests/rollback_index_test : LIBS += -ltlcl |
| 643 | |
| 644 | # TPM tests have special naming |
| 645 | # TODO: rename .c files to match test names |
| 646 | ${BUILD}/tests/tpm_lite/tpmtest_% : OBJS += ${BUILD}/tests/tpm_lite/tlcl_tests.o |
| 647 | ${BUILD}/tests/tpm_lite/tpmtest_% : ${BUILD}/tests/tpm_lite/%.o $$(OBJS) \ |
| 648 | $$(LIBS) |
| 649 | @printf " LDtpm $(subst $(BUILD)/,,$(@))\n" |
| 650 | $(Q)$(CC) $(CFLAGS) $(INCLUDES) $(LDFLAGS) $< $(OBJS) -o $@ \ |
| 651 | $(LIBS) $(LDLIBS) |
| 652 | |
| 653 | # TODO: port these tests to new API, if not already eqivalent |
| 654 | # functionality in other tests. These don't even compile at present. |
| 655 | # |
| 656 | # big_firmware_tests |
| 657 | # big_kernel_tests |
| 658 | # firmware_image_tests |
| 659 | # firmware_rollback_tests |
| 660 | # firmware_splicing_tests |
| 661 | # firmware_verify_benchmark |
| 662 | # kernel_image_tests |
| 663 | # kernel_rollback_tests |
| 664 | # kernel_splicing_tests |
| 665 | # kernel_verify_benchmark |
| 666 | # rollback_index_test |
| 667 | # verify_firmware_fuzz_driver |
| 668 | # verify_kernel_fuzz_driver |
| 669 | |
| 670 | # ----------------------------------------------------------------------------- |
| 671 | # Targets to run tests |
| 672 | |
| 673 | # Frequently-run tests |
| 674 | runtests : runbmptests runcgpttests runfuzztests runmisctests |
| 675 | |
| 676 | # Generate test keys |
| 677 | genkeys: |
| 678 | tests/gen_test_keys.sh |
| 679 | |
| 680 | # Generate test cases for fuzzing |
| 681 | genfuzztestcases: |
| 682 | tests/gen_fuzz_test_cases.sh |
| 683 | |
| 684 | runbmptests: utils |
| 685 | cd tests/bitmaps && BMPBLK=${BUILD}/utility/bmpblk_utility \ |
| 686 | ./TestBmpBlock.py -v |
| 687 | |
| 688 | runcgpttests : cgpt tests |
| 689 | ${BUILD}/tests/cgptlib_test |
| 690 | tests/run_cgpt_tests.sh ${BUILD}/cgpt/cgpt |
| 691 | ifneq ($(IN_CHROOT),) |
| 692 | ${BUILD}/tests/CgptManagerTests --v=1 |
| 693 | endif |
| 694 | |
| 695 | # Exercise vbutil_kernel and vbutil_firmware |
| 696 | runfuzztests: genfuzztestcases utils tests |
| 697 | tests/run_preamble_tests.sh |
| 698 | tests/run_vbutil_kernel_arg_tests.sh |
| 699 | |
| 700 | runmisctests : tests utils |
| 701 | ${BUILD}/tests/rollback_index2_tests |
| 702 | ${BUILD}/tests/rsa_utility_tests |
| 703 | ${BUILD}/tests/sha_tests |
| 704 | ${BUILD}/tests/stateful_util_tests |
| 705 | ${BUILD}/tests/tpm_bootmode_tests |
| 706 | ${BUILD}/tests/utility_string_tests |
| 707 | ${BUILD}/tests/utility_tests |
| 708 | ${BUILD}/tests/vboot_api_devmode_tests |
| 709 | ${BUILD}/tests/vboot_api_init_tests |
| 710 | ${BUILD}/tests/vboot_api_firmware_tests |
| 711 | ${BUILD}/tests/vboot_audio_tests |
| 712 | ${BUILD}/tests/vboot_firmware_tests |
| 713 | tests/run_rsa_tests.sh |
| 714 | tests/run_vboot_common_tests.sh |
| 715 | tests/run_vbutil_tests.sh |
| 716 | |
| 717 | # Run long tests, including all permutations of encryption keys (instead of |
| 718 | # just the ones we use) and tests of currently-unused code (e.g. vboot_ec). |
| 719 | # Not run by automated build. |
| 720 | runlongtests : genkeys genfuzztestcases tests utils |
| 721 | tests/run_preamble_tests.sh --all |
| 722 | tests/run_vboot_common_tests.sh --all |
| 723 | tests/run_vboot_ec_tests.sh |
| 724 | tests/run_vbutil_tests.sh --all |
| 725 | |
| 726 | # TODO: tests to run when ported to new API |
| 727 | # ./run_image_verification_tests.sh |
| 728 | # # Splicing tests |
| 729 | # ${BUILD}/tests/firmware_splicing_tests |
| 730 | # ${BUILD}/tests/kernel_splicing_tests |
| 731 | # # Rollback Tests |
| 732 | # ${BUILD}/tests/firmware_rollback_tests |
| 733 | # ${BUILD}/tests/kernel_rollback_tests |
| 734 | |
| 735 | # ----------------------------------------------------------------------------- |
| 736 | # Build rules |
| 737 | |
| 738 | ${BUILD}/% : ${BUILD}/%.o $$(OBJS) $$(LIBS) |
| 739 | @printf " LD $(subst $(BUILD)/,,$(@))\n" |
| 740 | $(Q)$(LD) $(CFLAGS) $(INCLUDES) $(LDFLAGS) $< $(OBJS) -o $@ \ |
| 741 | $(LIBS) $(LDLIBS) |
| 742 | |
| 743 | ${BUILD}/%.o : %.c |
| 744 | @printf " CC $(subst $(BUILD)/,,$(@))\n" |
| 745 | $(Q)$(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $< |
| 746 | |
| 747 | ${BUILD}/%.o : %.cc |
| 748 | @printf " CXX $(subst $(BUILD)/,,$(@))\n" |
| 749 | $(Q)$(CXX) $(CFLAGS) $(INCLUDES) -c -o $@ $< |
| 750 | |
| 751 | # ----------------------------------------------------------------------------- |
| 752 | # Dependencies must come last after ALL_OBJS has been accumulated |
| 753 | |
| 754 | # TODO: I suspect this is missing some object files. Make a temp |
| 755 | # target which cleans all known obj/exe's and see what's left; those |
| 756 | # are the files which need deps. |
| 757 | |
| 758 | ALL_DEPS += $(ALL_OBJS:%.o=%.o.d) |
| 759 | |
| 760 | -include ${ALL_DEPS} |