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 FWDIR ?= ../vboot_firmware/ | |
6 TOP ?= ../ | |
7 CC ?= gcc | |
8 CXX ?= g++ | |
9 INCLUDES += -I./include \ | 5 INCLUDES += -I./include \ |
10 -I$(FWDIR)/lib/include \ | 6 -I$(FWDIR)/lib/include \ |
11 -I$(FWDIR)/lib/cgptlib/include \ | 7 -I$(FWDIR)/lib/cgptlib/include \ |
12 -I$(FWDIR)/lib/cryptolib/include \ | 8 -I$(FWDIR)/lib/cryptolib/include \ |
13 -I$(HOSTDIR)/include \ | 9 -I$(HOSTDIR)/include \ |
14 -I../misclibs/include \ | 10 -I../misclibs/include \ |
15 -I../vfirmware/include\ | 11 -I../vfirmware/include\ |
16 -I../vboot_firmware/include\ | 12 -I../vboot_firmware/include\ |
17 -I../vkernel/include | 13 -I../vkernel/include |
18 CFLAGS ?= -Wall -DNDEBUG -O3 -Werror $(INCLUDES) | 14 CFLAGS += $(INCLUDES) |
19 LIBS = $(TOP)/misclibs/file_keys.o \ | 15 CFLAGS += -MMD -MF $@.d |
20 » $(TOP)/misclibs/signature_digest.o \ | 16 LIBS = $(BUILD)/misclibs/file_keys.o \ |
21 » $(TOP)/vfirmware/firmware_image.o \ | 17 » $(BUILD)/misclibs/signature_digest.o \ |
22 » $(TOP)/vkernel/kernel_image.o \ | 18 » $(BUILD)/vfirmware/firmware_image.o \ |
| 19 » $(BUILD)/vkernel/kernel_image.o \ |
23 $(HOSTLIB) \ | 20 $(HOSTLIB) \ |
24 $(FWLIB) | 21 $(FWLIB) |
25 | 22 |
| 23 BUILD_ROOT = ${BUILD}/utility |
| 24 |
26 DESTDIR ?= /usr/bin | 25 DESTDIR ?= /usr/bin |
27 | 26 |
28 TARGET_BINS = dumpRSAPublicKey \ | 27 TARGET_NAMES = dumpRSAPublicKey \ |
29 firmware_utility \ | 28 firmware_utility \ |
30 gbb_utility \ | 29 gbb_utility \ |
31 kernel_utility \ | 30 kernel_utility \ |
32 load_kernel_test \ | 31 load_kernel_test \ |
33 signature_digest_utility \ | 32 signature_digest_utility \ |
34 vbutil_key \ | 33 vbutil_key \ |
35 vbutil_kernel \ | 34 vbutil_kernel \ |
36 vbutil_keyblock \ | 35 vbutil_keyblock \ |
37 verify_data | 36 verify_data |
38 | 37 |
| 38 TARGET_BINS = $(addprefix ${BUILD_ROOT}/,$(TARGET_NAMES)) |
| 39 ALL_DEPS = $(addsuffix .d,${TARGET_BINS}) |
| 40 |
39 all: $(TARGET_BINS) | 41 all: $(TARGET_BINS) |
40 | 42 |
41 dumpRSAPublicKey: dumpRSAPublicKey.c | 43 ${BUILD_ROOT}/dumpRSAPublicKey: dumpRSAPublicKey.c |
42 $(CC) $(CFLAGS) $(INCLUDES) $< -o $@ -lcrypto | 44 $(CC) $(CFLAGS) $(INCLUDES) $< -o $@ -lcrypto |
43 | 45 |
44 firmware_utility: firmware_utility.cc $(LIBS) | 46 ${BUILD_ROOT}/firmware_utility: firmware_utility.cc $(LIBS) |
45 $(CXX) $(CFLAGS) $(INCLUDES) -ggdb -D__STDC_LIMIT_MACROS $< \ | 47 $(CXX) $(CFLAGS) $(INCLUDES) -ggdb -D__STDC_LIMIT_MACROS $< \ |
46 -o $@ $(LIBS) -lcrypto | 48 -o $@ $(LIBS) -lcrypto |
47 | 49 |
48 gbb_utility: gbb_utility.cc | 50 ${BUILD_ROOT}/gbb_utility: gbb_utility.cc |
49 » $(CXX) -DWITH_UTIL_MAIN $(CFLAGS) $(INCLUDES) $< -o $@ | 51 » $(CXX) -DWITH_UTIL_MAIN $(CFLAGS) $< -o $@ |
50 | 52 |
51 load_kernel_test: load_kernel_test.c $(LIBS) | 53 ${BUILD_ROOT}/load_kernel_test: load_kernel_test.c $(LIBS) |
52 $(CC) $(CFLAGS) $(INCLUDES) $< -o $@ $(LIBS) -lcrypto | 54 $(CC) $(CFLAGS) $(INCLUDES) $< -o $@ $(LIBS) -lcrypto |
53 | 55 |
54 kernel_utility: kernel_utility.cc $(LIBS) | 56 ${BUILD_ROOT}/kernel_utility: kernel_utility.cc $(LIBS) |
55 $(CXX) $(CFLAGS) $(INCLUDES) -ggdb -D__STDC_LIMIT_MACROS $< \ | 57 $(CXX) $(CFLAGS) $(INCLUDES) -ggdb -D__STDC_LIMIT_MACROS $< \ |
56 -o $@ $(LIBS) -lcrypto | 58 -o $@ $(LIBS) -lcrypto |
57 | 59 |
58 signature_digest_utility: signature_digest_utility.c $(LIBS) | 60 ${BUILD_ROOT}/signature_digest_utility: signature_digest_utility.c $(LIBS) |
59 $(CC) $(CFLAGS) $(INCLUDES) $< -o $@ $(LIBS) -lcrypto | 61 $(CC) $(CFLAGS) $(INCLUDES) $< -o $@ $(LIBS) -lcrypto |
60 | 62 |
61 vbutil_kernel: vbutil_kernel.c $(LIBS) | 63 ${BUILD_ROOT}/vbutil_kernel: vbutil_kernel.c $(LIBS) |
62 $(CC) $(CFLAGS) $(INCLUDES) $< -o $@ $(LIBS) -lcrypto | 64 $(CC) $(CFLAGS) $(INCLUDES) $< -o $@ $(LIBS) -lcrypto |
63 | 65 |
64 vbutil_key: vbutil_key.c $(LIBS) | 66 ${BUILD_ROOT}/vbutil_key: vbutil_key.c $(LIBS) |
65 $(CC) $(CFLAGS) $(INCLUDES) $< -o $@ $(LIBS) -lcrypto | 67 $(CC) $(CFLAGS) $(INCLUDES) $< -o $@ $(LIBS) -lcrypto |
66 | 68 |
67 vbutil_keyblock: vbutil_keyblock.c $(LIBS) | 69 ${BUILD_ROOT}/vbutil_keyblock: vbutil_keyblock.c $(LIBS) |
68 $(CC) $(CFLAGS) $(INCLUDES) $< -o $@ $(LIBS) -lcrypto | 70 $(CC) $(CFLAGS) $(INCLUDES) $< -o $@ $(LIBS) -lcrypto |
69 | 71 |
70 verify_data: verify_data.c $(LIBS) | 72 ${BUILD_ROOT}/verify_data: verify_data.c $(LIBS) |
71 $(CC) $(CFLAGS) $(INCLUDES) $< -o $@ $(LIBS) -lcrypto | 73 $(CC) $(CFLAGS) $(INCLUDES) $< -o $@ $(LIBS) -lcrypto |
72 | 74 |
73 clean: | |
74 rm -f $(TARGET_BINS) | |
75 | 75 |
76 install: $(TARGET_BINS) | 76 install: $(TARGET_BINS) |
77 mkdir -p $(DESTDIR) | 77 mkdir -p $(DESTDIR) |
78 cp -f $(TARGET_BINS) $(DESTDIR) | 78 cp -f $(TARGET_BINS) $(DESTDIR) |
79 » chmod a+rx $(patsubst %,$(DESTDIR)/%,$(TARGET_BINS)) | 79 » chmod a+rx $(patsubst %,$(DESTDIR)/%,$(TARGET_NAMES)) |
80 | 80 |
81 %o : %c | 81 -include ALL_DEPS |
82 » $(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $< | |
OLD | NEW |