blob: a9445e7ab01009e230e3865572c32f3553d55245 [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; \
Luigi Semenzato5896b962010-08-25 07:16:03 -070036 done; \
37 make -C utility update_tlcl_structures; \
Gaurav Shah322536d2010-01-28 15:01:23 -080038 for i in $(SUBDIRS); do \
Louis Yung-Chieh Lob31ddce2010-05-21 16:35:44 +080039 make -C $$i; \
Gaurav Shah322536d2010-01-28 15:01:23 -080040 done
41
42clean:
vbendeb70e95092010-06-14 15:41:27 -070043 /bin/rm -rf ${BUILD}
Bill Richardson371df8b2010-05-27 14:19:47 -070044
45install:
46 $(MAKE) -C utility install
Bill Richardsonf1372d92010-06-11 09:15:55 -070047 $(MAKE) -C cgpt install
Gaurav Shahe6421982010-06-03 07:49:32 -070048
49runtests:
50 $(MAKE) -C tests runtests
Luigi Semenzato18b814d2010-07-08 17:17:02 -070051
52rbtest:
53 $(MAKE) -C tests rbtest