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 LIBNAME = vboot_host.a | |
6 | |
7 CC ?= gcc | |
8 CFLAGS = -Wall -DNDEBUG -O3 -Werror | |
9 | |
10 HOSTTOP := $(shell pwd) | 5 HOSTTOP := $(shell pwd) |
11 LIBDIR = $(HOSTTOP)/lib | |
12 TESTDIR = $(HOSTTOP)/linktest | 6 TESTDIR = $(HOSTTOP)/linktest |
| 7 BUILD_ROOT := ${BUILD}/$(shell basename ${HOSTTOP}) |
13 | 8 |
14 INCLUDES += \ | 9 INCLUDES += \ |
15 -I$(HOSTTOP)/include \ | 10 -I$(HOSTTOP)/include \ |
16 -I$(FWDIR)/lib/include \ | 11 -I$(FWDIR)/lib/include \ |
17 -I$(FWDIR)/lib/cgptlib/include \ | 12 -I$(FWDIR)/lib/cgptlib/include \ |
18 » -I$(FWDIR)/lib/cryptolib/include | 13 » -I$(FWDIR)/lib/cryptolib/include |
19 | 14 |
20 # find ./lib -iname '*.c' | sort | 15 # find ./lib -iname '*.c' | sort |
21 LIB_SRCS = \ | 16 ALL_SRCS = \ |
22 ./lib/host_common.c \ | 17 ./lib/host_common.c \ |
23 ./lib/host_key.c \ | 18 ./lib/host_key.c \ |
24 ./lib/host_keyblock.c \ | 19 ./lib/host_keyblock.c \ |
25 ./lib/host_misc.c \ | 20 ./lib/host_misc.c \ |
26 » ./lib/host_signature.c | 21 » ./lib/host_signature.c |
27 | 22 |
28 LIB_OBJS = $(LIB_SRCS:%.c=%.o) | |
29 | 23 |
30 test : $(LIBNAME) | 24 test : $(HOSTLIB) |
31 » $(CC) $(CFLAGS) $(INCLUDES) -o $(TESTDIR)/a.out $(TESTDIR)/main.c \ | 25 » $(CC) $(CFLAGS) $(INCLUDES) -o $(BUILD_ROOT)/a.out $(TESTDIR)/main.c \ |
32 » $(LIBNAME) $(FWLIB) -lcrypto | 26 » $(HOSTLIB) $(FWLIB) -lcrypto |
33 | 27 |
34 $(LIBNAME) : $(LIB_OBJS) $(STUB_OBJS) | 28 include ../common.mk |
| 29 |
| 30 $(HOSTLIB) : $(ALL_OBJS) |
35 rm -f $@ | 31 rm -f $@ |
36 ar qc $@ $^ | 32 ar qc $@ $^ |
37 | |
38 %o : %c | |
39 $(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $< | |
40 | |
41 clean: FORCE | |
42 rm -f $(LIBNAME) $(LIB_OBJS) $(STUB_OBJS) $(TESTDIR)/a.out | |
43 | |
44 FORCE: | |
45 | |
46 | |
47 .PHONY: FORCE | |
OLD | NEW |