Gaurav Shah | 322536d | 2010-01-28 15:01:23 -0800 | [diff] [blame] | 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 |
| 3 | # found in the LICENSE file. |
| 4 | |
Gaurav Shah | 27bfc8b | 2010-02-17 14:19:24 -0800 | [diff] [blame] | 5 | export CC ?= gcc |
Bill Richardson | f1372d9 | 2010-06-11 09:15:55 -0700 | [diff] [blame] | 6 | export CXX ?= g++ |
vbendeb | b2b0fcc | 2010-07-15 15:09:47 -0700 | [diff] [blame] | 7 | export CFLAGS = -Wall -Werror -DCHROMEOS_ENVIRONMENT |
| 8 | ifeq (${DEBUG},) |
| 9 | CFLAGS += -O3 |
| 10 | else |
| 11 | CFLAGS += -O0 -g -DVBOOT_DEBUG |
| 12 | endif |
| 13 | ifeq (${DISABLE_NDEBUG},) |
| 14 | CFLAGS += -DNDEBUG |
| 15 | endif |
| 16 | |
Gaurav Shah | 7ca31f3 | 2010-02-16 19:04:11 -0800 | [diff] [blame] | 17 | export TOP = $(shell pwd) |
Randall Spangler | 620c38c | 2010-06-17 14:45:22 -0700 | [diff] [blame] | 18 | export FWDIR=$(TOP)/firmware |
Randall Spangler | d183644 | 2010-06-10 09:59:04 -0700 | [diff] [blame] | 19 | export HOSTDIR=$(TOP)/host |
Randall Spangler | d0dae7a | 2010-06-21 18:25:31 -0700 | [diff] [blame] | 20 | export INCLUDES = -I$(FWDIR)/include -I$(FWDIR)/stub/include |
Gaurav Shah | 322536d | 2010-01-28 15:01:23 -0800 | [diff] [blame] | 21 | |
vbendeb | 70e9509 | 2010-06-14 15:41:27 -0700 | [diff] [blame] | 22 | export BUILD = ${TOP}/build |
| 23 | export FWLIB = ${BUILD}/vboot_fw.a |
| 24 | export HOSTLIB= ${BUILD}/vboot_host.a |
Bill Richardson | 0b8f35c | 2010-05-26 09:18:38 -0700 | [diff] [blame] | 25 | |
Randall Spangler | 39f6611 | 2010-07-14 09:10:23 -0700 | [diff] [blame] | 26 | SUBDIRS = firmware host utility cgpt tests tests/tpm_lite |
Gaurav Shah | 322536d | 2010-01-28 15:01:23 -0800 | [diff] [blame] | 27 | |
| 28 | all: |
Louis Yung-Chieh Lo | b31ddce | 2010-05-21 16:35:44 +0800 | [diff] [blame] | 29 | set -e; \ |
vbendeb | 70e9509 | 2010-06-14 15:41:27 -0700 | [diff] [blame] | 30 | 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 Semenzato | 5896b96 | 2010-08-25 07:16:03 -0700 | [diff] [blame] | 36 | done; \ |
| 37 | make -C utility update_tlcl_structures; \ |
Gaurav Shah | 322536d | 2010-01-28 15:01:23 -0800 | [diff] [blame] | 38 | for i in $(SUBDIRS); do \ |
Louis Yung-Chieh Lo | b31ddce | 2010-05-21 16:35:44 +0800 | [diff] [blame] | 39 | make -C $$i; \ |
Gaurav Shah | 322536d | 2010-01-28 15:01:23 -0800 | [diff] [blame] | 40 | done |
| 41 | |
| 42 | clean: |
vbendeb | 70e9509 | 2010-06-14 15:41:27 -0700 | [diff] [blame] | 43 | /bin/rm -rf ${BUILD} |
Bill Richardson | 371df8b | 2010-05-27 14:19:47 -0700 | [diff] [blame] | 44 | |
| 45 | install: |
| 46 | $(MAKE) -C utility install |
Bill Richardson | f1372d9 | 2010-06-11 09:15:55 -0700 | [diff] [blame] | 47 | $(MAKE) -C cgpt install |
Gaurav Shah | e642198 | 2010-06-03 07:49:32 -0700 | [diff] [blame] | 48 | |
| 49 | runtests: |
| 50 | $(MAKE) -C tests runtests |
Luigi Semenzato | 18b814d | 2010-07-08 17:17:02 -0700 | [diff] [blame] | 51 | |
| 52 | rbtest: |
| 53 | $(MAKE) -C tests rbtest |