summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2011-11-14 13:46:33 -0800
committerStefan Reinauer <reinauer@chromium.org>2012-01-05 15:55:02 -0800
commitd4efe0cb4edfd7533da64971aa580495ffe6870e (patch)
treef7e5dd01cbc81ef14c507fcf0245595c77ad4522
parent60ab342c39d538e13ec281ab073cd01693d06f68 (diff)
downloadvboot-d4efe0cb4edfd7533da64971aa580495ffe6870e.tar.gz
Allow caller to specify build output directory
This changes the Makefile to set the BUILD directory only if the caller does not specify it. This allows U-Boot to build vboot reference and put the resulting binaries into its own output directory. BUG=chromium-os:16808 TEST=emerge vboot_reference-firmware for tegra2-seaboard, x86-mario Reviewed-on: https://gerrit.chromium.org/gerrit/11638 Reviewed-by: Bill Richardson <wfrichar@chromium.org> Commit-Ready: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org> (cherry picked from commit 6d696e532c6a0c93ad9b915c59dad4144e6f1b33) Change-Id: Id994d6d9f7d42ebbaa6ddd55ec0715b154f52fd5 Reviewed-on: https://gerrit.chromium.org/gerrit/13724 Reviewed-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Stefan Reinauer <reinauer@chromium.org>
-rw-r--r--Makefile10
1 files changed, 8 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 7652bde8..1e980592 100644
--- a/Makefile
+++ b/Makefile
@@ -5,6 +5,12 @@
export FIRMWARE_ARCH
export MOCK_TPM
+# This Makefile normally builds in a 'build' subdir, but use
+#
+# make BUILD=<dir>
+#
+# to put the output somewhere else
+
#
# Provide default CC and CFLAGS for firmware builds; if you have any -D flags,
# please add them after this point (e.g., -DVBOOT_DEBUG).
@@ -70,7 +76,7 @@ else
export INCLUDES = -I$(FWDIR)/include -I$(FWDIR)/arch/$(FIRMWARE_ARCH)/include
endif
-export BUILD = ${TOP}/build
+export BUILD ?= ${TOP}/build
export FWLIB = ${BUILD}/vboot_fw.a
export HOSTLIB = ${BUILD}/vboot_host.a
@@ -89,7 +95,7 @@ all:
mkdir -p $$newdir; \
fi; \
done; \
- [ -z "$(FIRMWARE_ARCH)" ] && make -C utility update_tlcl_structures; \
+ [ -z "$(FIRMWARE_ARCH)" ] && $(MAKE) -C utility update_tlcl_structures; \
for i in $(SUBDIRS); do \
make -C $$i; \
done