From 0732b8cc840efb5927bc143f5091a1da4c6e0dce Mon Sep 17 00:00:00 2001 From: Peter Korsgaard Date: Sun, 31 Aug 2008 20:23:47 +0000 Subject: [PATCH] buildroot: support out-of-tree builds Add support and documentation for out-of-tree builds with syntax like the Linux kernel (make O=). --- docs/buildroot.html | 14 ++++++++++++++ project/Makefile.in | 7 +++++++ 2 files changed, 21 insertions(+) diff --git a/docs/buildroot.html b/docs/buildroot.html index 6e20d04199..89c59701b6 100644 --- a/docs/buildroot.html +++ b/docs/buildroot.html @@ -217,6 +217,20 @@

You can now disconnect or copy the content of your dl directory to the build-host.

+

+ Building out-of-tree

+ +

Buildroot supports building out of tree with a syntax similar + to the Linux kernel. To use it, add O=<directory> to the + make command line, E.G.:

+ +
+ $ make O=/tmp/build
+
+ +

And all the output files will be located under + /tmp/build.

+

Environment variables

diff --git a/project/Makefile.in b/project/Makefile.in index c4188505ba..034b1fa6c9 100644 --- a/project/Makefile.in +++ b/project/Makefile.in @@ -25,7 +25,14 @@ TAR_OPTIONS=$(subst ",, $(BR2_TAR_OPTIONS)) -xf #") +# Buildroot supports building out of tree similarly to the Linux kernel. +# To use, add O= to the make command line (make O=/tmp/build) BASE_DIR:=$(shell pwd) +ifdef O +ifeq ("$(origin O)", "command line") +BASE_DIR := $(O) +endif +endif TOPDIR_PREFIX:=$(strip $(subst ",, $(BR2_TOPDIR_PREFIX)))_ #")) -- 2.30.2