blob: 9f12daa4e662538a55768192567bae511c5aae3c [file] [log] [blame]
Gaurav Shah322536d2010-01-28 15:01:23 -08001# 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
3# found in the LICENSE file.
4
Gaurav Shah27bfc8b2010-02-17 14:19:24 -08005export CC ?= gcc
Bill Richardsonf1372d92010-06-11 09:15:55 -07006export CXX ?= g++
vbendebb2b0fcc2010-07-15 15:09:47 -07007export CFLAGS = -Wall -Werror -DCHROMEOS_ENVIRONMENT
8ifeq (${DEBUG},)
9CFLAGS += -O3
10else
11CFLAGS += -O0 -g -DVBOOT_DEBUG
12endif
13ifeq (${DISABLE_NDEBUG},)
14CFLAGS += -DNDEBUG
15endif
16
Gaurav Shah7ca31f32010-02-16 19:04:11 -080017export TOP = $(shell pwd)
Randall Spangler620c38c2010-06-17 14:45:22 -070018export FWDIR=$(TOP)/firmware
Randall Spanglerd1836442010-06-10 09:59:04 -070019export HOSTDIR=$(TOP)/host
Randall Spanglerd0dae7a2010-06-21 18:25:31 -070020export INCLUDES = -I$(FWDIR)/include -I$(FWDIR)/stub/include
Gaurav Shah322536d2010-01-28 15:01:23 -080021
vbendeb70e95092010-06-14 15:41:27 -070022export BUILD = ${TOP}/build
23export FWLIB = ${BUILD}/vboot_fw.a
24export HOSTLIB= ${BUILD}/vboot_host.a
Bill Richardson0b8f35c2010-05-26 09:18:38 -070025
Randall Spangler39f66112010-07-14 09:10:23 -070026SUBDIRS = firmware host utility cgpt tests tests/tpm_lite
Gaurav Shah322536d2010-01-28 15:01:23 -080027
28all:
Louis Yung-Chieh Lob31ddce2010-05-21 16:35:44 +080029 set -e; \
vbendeb70e95092010-06-14 15:41:27 -070030 for d in $(shell find ${SUBDIRS} -name '*.c' -exec dirname {} \; |\
31 sort -u); do \
32 newdir=${BUILD}/$$d; \
33 if [ ! -d $$newdir ]; then \
34 mkdir -p $$newdir; \
35 fi; \
36 done && \
Gaurav Shah322536d2010-01-28 15:01:23 -080037 for i in $(SUBDIRS); do \
Louis Yung-Chieh Lob31ddce2010-05-21 16:35:44 +080038 make -C $$i; \
Gaurav Shah322536d2010-01-28 15:01:23 -080039 done
40
41clean:
vbendeb70e95092010-06-14 15:41:27 -070042 /bin/rm -rf ${BUILD}
Bill Richardson371df8b2010-05-27 14:19:47 -070043
44install:
45 $(MAKE) -C utility install
Bill Richardsonf1372d92010-06-11 09:15:55 -070046 $(MAKE) -C cgpt install
Gaurav Shahe6421982010-06-03 07:49:32 -070047
48runtests:
49 $(MAKE) -C tests runtests
Luigi Semenzato18b814d2010-07-08 17:17:02 -070050
51rbtest:
52 $(MAKE) -C tests rbtest
Randall Spangler39f66112010-07-14 09:10:23 -070053
54update_tlcl_structures:
55 $(MAKE) -C utility update_tlcl_structures