From patchwork Sat Dec 22 23:04:19 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Belisko X-Patchwork-Id: 207942 X-Patchwork-Delegate: patrickdepinguin+buildroot@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id 4D9562C008E for ; Sun, 23 Dec 2012 10:04:56 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 653ADFFE6F; Sat, 22 Dec 2012 23:04:45 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ikrI+Lg7MUEz; Sat, 22 Dec 2012 23:04:42 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id F1184FFCC7; Sat, 22 Dec 2012 23:04:41 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 7FC838F74B for ; Sat, 22 Dec 2012 23:04:44 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id BDC2DFF99F for ; Sat, 22 Dec 2012 23:04:29 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1tcBa8C65Yc9 for ; Sat, 22 Dec 2012 23:04:28 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ee0-f50.google.com (mail-ee0-f50.google.com [74.125.83.50]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 0FBB7FF99E for ; Sat, 22 Dec 2012 23:04:27 +0000 (UTC) Received: by mail-ee0-f50.google.com with SMTP id b45so3120228eek.9 for ; Sat, 22 Dec 2012 15:04:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=eIuvYDqdLhEytFkzYkOjewo/l8OSyMI+5nd+8cTg/aA=; b=Rxgi8fB702+fvFdGFOwIRgPvcg3uqAP2wV6waWZgDOP1g0ZYASZdVXcPZ5gOpVqSIv llnyhwdx91OOIx1Mqw3ziDpflLNg4DE2RAquLTrUWJt0dAVEaUn6XcQDc9hAb8q/JzBT 8JnDSSry9gQxu9R2lTWU0aJNdMeYdfRc3BmcYLOdPA4ETpILwLtipgc0hDhvhOzFVJtF TLx49/PR+g16bWc22pLoYFafrRis3sxNXTk8lJ14Gm+T0lcQtRoWIvoYrj4a5+e+jlrJ oGVw2Krr1KgHvuMbFptsnv34keJSAXP/Bntp5qscW2iaE91dVp1h+B3Lem4+kGqxBFJ1 OG6w== X-Received: by 10.14.204.198 with SMTP id h46mr43545796eeo.1.1356217475263; Sat, 22 Dec 2012 15:04:35 -0800 (PST) Received: from localhost.localdomain (dial-95-105-233-192.orange.sk. [95.105.233.192]) by mx.google.com with ESMTPS id r1sm30928963eeo.2.2012.12.22.15.04.33 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 22 Dec 2012 15:04:34 -0800 (PST) From: Marek Belisko To: buildroot@uclibc.org Date: Sun, 23 Dec 2012 00:04:19 +0100 Message-Id: <1356217460-20232-2-git-send-email-marek.belisko@open-nandra.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1356217460-20232-1-git-send-email-marek.belisko@open-nandra.com> References: <1356217460-20232-1-git-send-email-marek.belisko@open-nandra.com> Cc: Marek Belisko Subject: [Buildroot] [RFC 1/2] barebox: Build barebox in separate directory. X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net This is necessary when we would like to add support for building also barebox xloader (MLO). Signed-off-by: Marek Belisko --- boot/barebox/barebox.mk | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/boot/barebox/barebox.mk b/boot/barebox/barebox.mk index a025d5f..16110b9 100644 --- a/boot/barebox/barebox.mk +++ b/boot/barebox/barebox.mk @@ -54,9 +54,12 @@ else ifeq ($(BR2_TARGET_BAREBOX_USE_CUSTOM_CONFIG),y) BAREBOX_SOURCE_CONFIG = $(BR2_TARGET_BAREBOX_CUSTOM_CONFIG_FILE) endif +BAREBOX_BUILD_DIR = barebox + define BAREBOX_CONFIGURE_CMDS + mkdir -p $(@D)/$(BAREBOX_BUILD_DIR) cp $(BAREBOX_SOURCE_CONFIG) $(@D)/arch/$(BAREBOX_ARCH)/configs/buildroot_defconfig - $(MAKE) $(BAREBOX_MAKE_FLAGS) -C $(@D) buildroot_defconfig + $(MAKE) $(BAREBOX_MAKE_FLAGS) -C $(@D) buildroot_defconfig O=$(BAREBOX_BUILD_DIR) endef ifeq ($(BR2_TARGET_BAREBOX_BAREBOXENV),y) @@ -68,11 +71,11 @@ endif define BAREBOX_BUILD_CMDS $(BAREBOX_BUILD_BAREBOXENV_CMDS) - $(MAKE) $(BAREBOX_MAKE_FLAGS) -C $(@D) + $(MAKE) $(BAREBOX_MAKE_FLAGS) -C $(@D) O=$(BAREBOX_BUILD_DIR) endef define BAREBOX_INSTALL_IMAGES_CMDS - cp $(@D)/barebox.bin $(BINARIES_DIR) + cp $(@D)/$(BAREBOX_BUILD_DIR)/barebox.bin $(BINARIES_DIR) endef ifeq ($(BR2_TARGET_BAREBOX_BAREBOXENV),y) @@ -97,15 +100,15 @@ barebox-menuconfig barebox-xconfig barebox-gconfig barebox-nconfig: barebox-conf rm -f $(BAREBOX_DIR)/.stamp_{built,target_installed,images_installed} barebox-savedefconfig: barebox-configure - $(MAKE) $(BAREBOX_MAKE_FLAGS) -C $(BAREBOX_DIR) \ + $(MAKE) $(BAREBOX_MAKE_FLAGS) -C $(BAREBOX_DIR) O=$(BAREBOX_BUILD_DIR) \ $(subst barebox-,,$@) ifeq ($(BR2_TARGET_BAREBOX_USE_CUSTOM_CONFIG),y) -barebox-update-config: barebox-configure $(BAREBOX_DIR)/.config - cp -f $(BAREBOX_DIR)/.config $(BR2_TARGET_BAREBOX_CUSTOM_CONFIG_FILE) +barebox-update-config: barebox-configure $(BAREBOX_DIR)/$(BAREBOX_BUILD_DIR)/.config + cp -f $(BAREBOX_DIR)/$(BAREBOX_BUILD_DIR)/.config $(BR2_TARGET_BAREBOX_CUSTOM_CONFIG_FILE) barebox-update-defconfig: barebox-savedefconfig - cp -f $(BAREBOX_DIR)/defconfig $(BR2_TARGET_BAREBOX_CUSTOM_CONFIG_FILE) + cp -f $(BAREBOX_DIR)/$(BAREBOX_BUILD_DIR)/defconfig $(BR2_TARGET_BAREBOX_CUSTOM_CONFIG_FILE) else barebox-update-config: ; barebox-update-defconfig: ;