| OLD | NEW |
| 1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 FWTOP := $(shell pwd) | 5 FWTOP := $(shell pwd) |
| 6 LIBDIR = $(FWTOP)/lib | 6 LIBDIR = $(FWTOP)/lib |
| 7 STUBDIR = $(FWTOP)/stub | 7 STUBDIR = $(FWTOP)/stub |
| 8 TESTDIR = $(FWTOP)/linktest | 8 TESTDIR = $(FWTOP)/linktest |
| 9 BUILD_ROOT := ${BUILD}/$(shell basename ${FWTOP}) | 9 BUILD_ROOT := ${BUILD}/$(shell basename ${FWTOP}) |
| 10 LIBS = $(FWLIB) # Firmware library must be self-contained | 10 LIBS = $(FWLIB) # Firmware library must be self-contained |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 ./lib/cryptolib/sha2.c \ | 33 ./lib/cryptolib/sha2.c \ |
| 34 ./lib/cryptolib/sha_utility.c \ | 34 ./lib/cryptolib/sha_utility.c \ |
| 35 ./lib/rollback_index.c \ | 35 ./lib/rollback_index.c \ |
| 36 ./lib/stateful_util.c \ | 36 ./lib/stateful_util.c \ |
| 37 ./lib/tpm_lite/tlcl.c \ | 37 ./lib/tpm_lite/tlcl.c \ |
| 38 ./lib/utility.c \ | 38 ./lib/utility.c \ |
| 39 ./lib/vboot_common.c \ | 39 ./lib/vboot_common.c \ |
| 40 ./lib/vboot_firmware.c \ | 40 ./lib/vboot_firmware.c \ |
| 41 ./lib/vboot_kernel.c | 41 ./lib/vboot_kernel.c |
| 42 | 42 |
| 43 LIB_OBJS = $(LIB_SRCS:%.c=${BUILD_ROOT}/%.o) |
| 44 |
| 43 STUB_SRCS = \ | 45 STUB_SRCS = \ |
| 44 ./stub/boot_device_stub.c \ | 46 ./stub/boot_device_stub.c \ |
| 45 ./stub/load_firmware_stub.c \ | 47 ./stub/load_firmware_stub.c \ |
| 46 ./stub/tpm_lite_stub.c \ | 48 ./stub/tpm_lite_stub.c \ |
| 47 ./stub/utility_stub.c | 49 ./stub/utility_stub.c |
| 48 | 50 |
| 51 STUB_OBJS = $(STUB_SRCS:%.c=${BUILD_ROOT}/%.o) |
| 52 |
| 49 ALL_SRCS = ${LIB_SRCS} ${STUB_SRCS} version.c | 53 ALL_SRCS = ${LIB_SRCS} ${STUB_SRCS} version.c |
| 50 | 54 |
| 51 test : $(FWLIB) update-version | 55 test : $(STUB_OBJS) $(FWLIB) update-version |
| 52 $(CC) $(CFLAGS) $(INCLUDES) -o $(BUILD_ROOT)/a.out \ | 56 $(CC) $(CFLAGS) $(INCLUDES) -o $(BUILD_ROOT)/a.out \ |
| 53 » » $(TESTDIR)/main.c $(LIBS) | 57 » » $(TESTDIR)/main.c $(STUB_OBJS) $(LIBS) |
| 54 | 58 |
| 55 # This is executed at every make, to see if anything has changed | 59 # This is executed at every make, to see if anything has changed |
| 56 update-version : | 60 update-version : |
| 57 find \( -name '*.[ch]' -o -name 'Makefile*' \) -a \! -name version.c \ | 61 find \( -name '*.[ch]' -o -name 'Makefile*' \) -a \! -name version.c \ |
| 58 | sort | xargs cat | md5sum | cut -c 25-32 > \ | 62 | sort | xargs cat | md5sum | cut -c 25-32 > \ |
| 59 ${BUILD_ROOT}/x.tmp && \ | 63 ${BUILD_ROOT}/x.tmp && \ |
| 60 echo "char* VbootVersion = \"VBOOv=$$(cat ${BUILD_ROOT}/x.tmp)\";" > \ | 64 echo "char* VbootVersion = \"VBOOv=$$(cat ${BUILD_ROOT}/x.tmp)\";" > \ |
| 61 ${BUILD_ROOT}/version.tmp && \ | 65 ${BUILD_ROOT}/version.tmp && \ |
| 62 (cmp -s ${BUILD_ROOT}/version.tmp version.c || \ | 66 (cmp -s ${BUILD_ROOT}/version.tmp version.c || \ |
| 63 ( echo "** Updating version.c **" && \ | 67 ( echo "** Updating version.c **" && \ |
| 64 cp ${BUILD_ROOT}/version.tmp version.c)) | 68 cp ${BUILD_ROOT}/version.tmp version.c)) |
| 65 | 69 |
| 66 include ../common.mk | 70 include ../common.mk |
| 67 | 71 |
| 68 $(FWLIB) : $(ALL_OBJS) | 72 $(FWLIB) : $(LIB_OBJS) |
| 69 rm -f $@ | 73 rm -f $@ |
| 70 ar qc $@ $^ | 74 ar qc $@ $^ |
| OLD | NEW |