summaryrefslogtreecommitdiff
path: root/Makefile
blob: 9f12daa4e662538a55768192567bae511c5aae3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

export CC ?= gcc
export CXX ?= g++
export CFLAGS = -Wall -Werror -DCHROMEOS_ENVIRONMENT
ifeq (${DEBUG},)
CFLAGS += -O3
else
CFLAGS += -O0 -g -DVBOOT_DEBUG
endif
ifeq (${DISABLE_NDEBUG},)
CFLAGS += -DNDEBUG
endif

export TOP = $(shell pwd)
export FWDIR=$(TOP)/firmware
export HOSTDIR=$(TOP)/host
export INCLUDES = -I$(FWDIR)/include -I$(FWDIR)/stub/include

export BUILD = ${TOP}/build
export FWLIB = ${BUILD}/vboot_fw.a
export HOSTLIB= ${BUILD}/vboot_host.a

SUBDIRS = firmware host utility cgpt tests tests/tpm_lite

all:
	set -e; \
	for d in $(shell find ${SUBDIRS} -name '*.c' -exec  dirname {} \; |\
		 sort -u); do \
		newdir=${BUILD}/$$d; \
		if [ ! -d $$newdir ]; then \
			mkdir -p $$newdir; \
		fi; \
	done && \
	for i in $(SUBDIRS); do \
		make -C $$i; \
	done

clean:
	/bin/rm -rf ${BUILD}

install:
	$(MAKE) -C utility install
	$(MAKE) -C cgpt install

runtests:
	$(MAKE) -C tests runtests

rbtest:
	$(MAKE) -C tests rbtest

update_tlcl_structures:
	$(MAKE) -C utility update_tlcl_structures