blob: 4022dafdaa8a499c23bfbbe39bf0a3b7bac662bc [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++
Gaurav Shah456678b2010-03-10 18:38:45 -08007export CFLAGS = -Wall -DNDEBUG -O3 -Werror
Gaurav Shah7ca31f32010-02-16 19:04:11 -08008export TOP = $(shell pwd)
Bill Richardson0b8f35c2010-05-26 09:18:38 -07009export FWDIR=$(TOP)/vboot_firmware
Randall Spanglerd1836442010-06-10 09:59:04 -070010export HOSTDIR=$(TOP)/host
Gaurav Shahfc70d722010-03-31 13:26:55 -070011export INCLUDES = \
Bill Richardson0b8f35c2010-05-26 09:18:38 -070012 -I$(FWDIR)/include \
Randall Spangler3003c1d2010-05-27 09:20:11 -070013 -I$(TOP)/misclibs/include
Gaurav Shah322536d2010-01-28 15:01:23 -080014
vbendeb70e95092010-06-14 15:41:27 -070015export BUILD = ${TOP}/build
16export FWLIB = ${BUILD}/vboot_fw.a
17export HOSTLIB= ${BUILD}/vboot_host.a
Bill Richardson0b8f35c2010-05-26 09:18:38 -070018
vbendeb70e95092010-06-14 15:41:27 -070019SUBDIRS = vboot_firmware misclibs host vfirmware vkernel utility cgpt tests
Gaurav Shah322536d2010-01-28 15:01:23 -080020
21all:
Louis Yung-Chieh Lob31ddce2010-05-21 16:35:44 +080022 set -e; \
vbendeb70e95092010-06-14 15:41:27 -070023 for d in $(shell find ${SUBDIRS} -name '*.c' -exec dirname {} \; |\
24 sort -u); do \
25 newdir=${BUILD}/$$d; \
26 if [ ! -d $$newdir ]; then \
27 mkdir -p $$newdir; \
28 fi; \
29 done && \
Gaurav Shah322536d2010-01-28 15:01:23 -080030 for i in $(SUBDIRS); do \
Louis Yung-Chieh Lob31ddce2010-05-21 16:35:44 +080031 make -C $$i; \
Gaurav Shah322536d2010-01-28 15:01:23 -080032 done
33
34clean:
vbendeb70e95092010-06-14 15:41:27 -070035 /bin/rm -rf ${BUILD}
Bill Richardson371df8b2010-05-27 14:19:47 -070036
37install:
38 $(MAKE) -C utility install
Bill Richardsonf1372d92010-06-11 09:15:55 -070039 $(MAKE) -C cgpt install
Gaurav Shahe6421982010-06-03 07:49:32 -070040
41runtests:
42 $(MAKE) -C tests runtests