Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Korsgaard <jacmet@uclibc.org>
To: buildroot@busybox.net
Subject: [Buildroot] Out of tree builds (was Re: svn commit: trunk/buildroot)
Date: Mon, 23 Jun 2008 15:58:14 +0200	[thread overview]
Message-ID: <87bq1si77t.fsf@macbook.be.48ers.dk> (raw)
In-Reply-To: <20080623134749.009043C2B3@busybox.net> (jacmet@uclibc.org's message of "Mon\, 23 Jun 2008 06\:47\:48 -0700 \(PDT\)")

>>>>> "jacmet" == jacmet  <jacmet@uclibc.org> writes:

Hi,

 jacmet> Author: jacmet
 jacmet> Date: 2008-06-23 06:47:37 -0700 (Mon, 23 Jun 2008)
 jacmet> New Revision: 22481

 jacmet> Log:
 jacmet> Makefile: don't include .config from TOPDIR

 jacmet> If we ever want to support building out of tree, having the
 jacmet> .config in the tree is probably not what we want.

Do we want to support out of tree builds? The toplevel Makefile has
had a TOPDIR variable since forever, but it'll take a bit of work to
get it running.

The basics are easy to do, E.G.:

diff --git a/Makefile b/Makefile
index 73d9208..b81d330 100644
--- a/Makefile
+++ b/Makefile
@@ -21,10 +21,17 @@
 # Just run 'make menuconfig', configure stuff, then run 'make'.
 # You shouldn't need to mess with anything beyond this point...
 #--------------------------------------------------------------
-TOPDIR=./
-CONFIG_CONFIG_IN=Config.in
-CONFIG_DEFCONFIG=.defconfig
+
+# buildroot sources are in same directory as Makefile
+TOPDIR:=$(dir $(firstword $(MAKEFILE_LIST)))
+
+# for kbuild
+srctree:=$(TOPDIR)
+export srctree
+
+CONFIG_CONFIG_IN=$(TOPDIR)/Config.in
+CONFIG_DEFCONFIG=$(TOPDIR)/.defconfig
-CONFIG=package/config
+CONFIG=$(TOPDIR)/package/config
 DATE:=$(shell date +%Y%m%d)
 
 noconfig_targets:=menuconfig config oldconfig randconfig \

But the big issue is everywhere we expect to be in the source
directory, so we'll need to prepend $(TOPDIR)/ to every include line
(make -I doesn't work for wildcards), patch-kernel.sh calls and so on.

With all that in place it should be possible to do:

% mkdir build && cd build
% make -f /path/to/buildroot/Makefile  menuconfig
% make -f /path/to/buildroot/Makefile

What do you say?

-- 
Bye, Peter Korsgaard

      reply	other threads:[~2008-06-23 13:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-23 13:47 [Buildroot] svn commit: trunk/buildroot jacmet at uclibc.org
2008-06-23 13:58 ` Peter Korsgaard [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bq1si77t.fsf@macbook.be.48ers.dk \
    --to=jacmet@uclibc.org \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox