Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(283)

Unified Diff: Makefile

Issue 5301004: Add firmware build mode to Makefiles (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/vboot_reference.git@master
Patch Set: Add arch/ into in README Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | firmware/Makefile » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Makefile
diff --git a/Makefile b/Makefile
index 15ef63813c1ff66de86e740ca5224ac87c034646..36250fb67df56a76791c1e34ba88eab4887dc907 100644
--- a/Makefile
+++ b/Makefile
@@ -2,14 +2,22 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+export FIRMWARE_ARCH
+
export CC ?= gcc
export CXX ?= g++
+ifeq ($(FIRMWARE_ARCH),)
export CFLAGS = -Wall -Werror -DCHROMEOS_ENVIRONMENT
+else
+export CFLAGS = -Wall -Werror
+endif
+
ifeq (${DEBUG},)
CFLAGS += -O3
else
CFLAGS += -O0 -g -DVBOOT_DEBUG
endif
+
ifeq (${DISABLE_NDEBUG},)
CFLAGS += -DNDEBUG
endif
@@ -17,13 +25,21 @@ endif
export TOP = $(shell pwd)
export FWDIR=$(TOP)/firmware
export HOSTDIR=$(TOP)/host
+ifeq ($(FIRMWARE_ARCH),)
export INCLUDES = -I$(FWDIR)/include -I$(FWDIR)/stub/include
+else
+export INCLUDES = -I$(FWDIR)/include -I$(FWDIR)/arch/$(FIRMWARE_ARCH)/include
+endif
export BUILD = ${TOP}/build
export FWLIB = ${BUILD}/vboot_fw.a
export HOSTLIB = ${BUILD}/vboot_host.a
+ifeq ($(FIRMWARE_ARCH),)
SUBDIRS = firmware host utility cgpt tests tests/tpm_lite
+else
+SUBDIRS = firmware
+endif
all:
set -e; \
@@ -34,7 +50,7 @@ all:
mkdir -p $$newdir; \
fi; \
done; \
- make -C utility update_tlcl_structures; \
+ [ -z "$(FIRMWARE_ARCH)" ] && make -C utility update_tlcl_structures; \
for i in $(SUBDIRS); do \
make -C $$i; \
done
« no previous file with comments | « no previous file | firmware/Makefile » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698