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 export FIRMWARE_ARCH |
| 6 |
5 export CC ?= gcc | 7 export CC ?= gcc |
6 export CXX ?= g++ | 8 export CXX ?= g++ |
| 9 ifeq ($(FIRMWARE_ARCH),) |
7 export CFLAGS = -Wall -Werror -DCHROMEOS_ENVIRONMENT | 10 export CFLAGS = -Wall -Werror -DCHROMEOS_ENVIRONMENT |
| 11 else |
| 12 export CFLAGS = -Wall -Werror |
| 13 endif |
| 14 |
8 ifeq (${DEBUG},) | 15 ifeq (${DEBUG},) |
9 CFLAGS += -O3 | 16 CFLAGS += -O3 |
10 else | 17 else |
11 CFLAGS += -O0 -g -DVBOOT_DEBUG | 18 CFLAGS += -O0 -g -DVBOOT_DEBUG |
12 endif | 19 endif |
| 20 |
13 ifeq (${DISABLE_NDEBUG},) | 21 ifeq (${DISABLE_NDEBUG},) |
14 CFLAGS += -DNDEBUG | 22 CFLAGS += -DNDEBUG |
15 endif | 23 endif |
16 | 24 |
17 export TOP = $(shell pwd) | 25 export TOP = $(shell pwd) |
18 export FWDIR=$(TOP)/firmware | 26 export FWDIR=$(TOP)/firmware |
19 export HOSTDIR=$(TOP)/host | 27 export HOSTDIR=$(TOP)/host |
| 28 ifeq ($(FIRMWARE_ARCH),) |
20 export INCLUDES = -I$(FWDIR)/include -I$(FWDIR)/stub/include | 29 export INCLUDES = -I$(FWDIR)/include -I$(FWDIR)/stub/include |
| 30 else |
| 31 export INCLUDES = -I$(FWDIR)/include -I$(FWDIR)/arch/$(FIRMWARE_ARCH)/include |
| 32 endif |
21 | 33 |
22 export BUILD = ${TOP}/build | 34 export BUILD = ${TOP}/build |
23 export FWLIB = ${BUILD}/vboot_fw.a | 35 export FWLIB = ${BUILD}/vboot_fw.a |
24 export HOSTLIB = ${BUILD}/vboot_host.a | 36 export HOSTLIB = ${BUILD}/vboot_host.a |
25 | 37 |
| 38 ifeq ($(FIRMWARE_ARCH),) |
26 SUBDIRS = firmware host utility cgpt tests tests/tpm_lite | 39 SUBDIRS = firmware host utility cgpt tests tests/tpm_lite |
| 40 else |
| 41 SUBDIRS = firmware |
| 42 endif |
27 | 43 |
28 all: | 44 all: |
29 set -e; \ | 45 set -e; \ |
30 for d in $(shell find ${SUBDIRS} -name '*.c' -exec dirname {} \; |\ | 46 for d in $(shell find ${SUBDIRS} -name '*.c' -exec dirname {} \; |\ |
31 sort -u); do \ | 47 sort -u); do \ |
32 newdir=${BUILD}/$$d; \ | 48 newdir=${BUILD}/$$d; \ |
33 if [ ! -d $$newdir ]; then \ | 49 if [ ! -d $$newdir ]; then \ |
34 mkdir -p $$newdir; \ | 50 mkdir -p $$newdir; \ |
35 fi; \ | 51 fi; \ |
36 done; \ | 52 done; \ |
37 » make -C utility update_tlcl_structures; \ | 53 » [ -z "$(FIRMWARE_ARCH)" ] && make -C utility update_tlcl_structures; \ |
38 for i in $(SUBDIRS); do \ | 54 for i in $(SUBDIRS); do \ |
39 make -C $$i; \ | 55 make -C $$i; \ |
40 done | 56 done |
41 | 57 |
42 clean: | 58 clean: |
43 /bin/rm -rf ${BUILD} | 59 /bin/rm -rf ${BUILD} |
44 | 60 |
45 install: | 61 install: |
46 $(MAKE) -C utility install | 62 $(MAKE) -C utility install |
47 $(MAKE) -C cgpt install | 63 $(MAKE) -C cgpt install |
48 | 64 |
49 runtests: | 65 runtests: |
50 $(MAKE) -C tests runtests | 66 $(MAKE) -C tests runtests |
51 | 67 |
52 rbtest: | 68 rbtest: |
53 $(MAKE) -C tests rbtest | 69 $(MAKE) -C tests rbtest |
OLD | NEW |