From patchwork Thu Sep 5 21:27:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 272973 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id 10FCC2C00AC for ; Fri, 6 Sep 2013 07:28:11 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 36A218D064; Thu, 5 Sep 2013 21:28:10 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3wske1FLRCEV; Thu, 5 Sep 2013 21:28:04 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 0B96E8D071; Thu, 5 Sep 2013 21:28:00 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id EA7F61BF842 for ; Thu, 5 Sep 2013 21:27:55 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id D874B31ABD for ; Thu, 5 Sep 2013 21:27:45 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Huqnh85Qthz4 for ; Thu, 5 Sep 2013 21:27:45 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.free-electrons.com (top.free-electrons.com [176.31.233.9]) by silver.osuosl.org (Postfix) with ESMTP id AFACC312A4 for ; Thu, 5 Sep 2013 21:27:44 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 106) id EEC68951; Thu, 5 Sep 2013 23:27:55 +0200 (CEST) Received: from localhost (AToulouse-651-1-138-58.w109-222.abo.wanadoo.fr [109.222.217.58]) by mail.free-electrons.com (Postfix) with ESMTPSA id A3CB08EC for ; Thu, 5 Sep 2013 23:27:55 +0200 (CEST) From: Thomas Petazzoni To: buildroot@uclibc.org Date: Thu, 5 Sep 2013 23:27:43 +0200 Message-Id: <1378416469-17708-6-git-send-email-thomas.petazzoni@free-electrons.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1378416469-17708-1-git-send-email-thomas.petazzoni@free-electrons.com> References: <1378416469-17708-1-git-send-email-thomas.petazzoni@free-electrons.com> Subject: [Buildroot] [RFCv1 05/11] toolchain: introduce a virtual package 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 commit introduces a virtual package called 'toolchain', located in 'toolchain/toolchain', which simply depends on 'toolchain-buildroot' or 'toolchain-external' depending on the selected toolchain backend. For now, toolchain-buildroot and toolchain-external are still manual make targets, but the following patches convert those backends to use the package infrastructure as well. In addition to this: * The main Makefile is modified to always make BASE_TARGETS point to this new toolchain virtual package. * The main Makefile is changed to include all the toolchain/*/*.mk files: the toolchain virtual package, and the toolchain-buildroot and toolchain-external directories. * The dependency of the toolchain on prepare dirs and dependencies is moved to the toolchain virtual package. It is moved as a prerequisite of the "toolchain-source" rule to ensure that all directories are prepared before we even start extracting the toolchain. Signed-off-by: Thomas Petazzoni Acked-by: Luca Ceresoli Acked-by: Thomas De Schampheleire --- Makefile | 18 +++--------------- toolchain/toolchain/toolchain.mk | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 15 deletions(-) create mode 100644 toolchain/toolchain/toolchain.mk diff --git a/Makefile b/Makefile index f64a101..f2430eb 100644 --- a/Makefile +++ b/Makefile @@ -222,11 +222,7 @@ GNU_HOST_NAME:=$(shell support/gnuconfig/config.guess) # ################################################################################ -ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y) -BASE_TARGETS += toolchain-buildroot -else ifeq ($(BR2_TOOLCHAIN_EXTERNAL),y) -BASE_TARGETS += toolchain-external -endif +BASE_TARGETS = toolchain TARGETS:= @@ -316,11 +312,7 @@ include support/dependencies/dependencies.mk # We also need the various per-package makefiles, which also add # each selected package to TARGETS if that package was selected # in the .config file. -ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y) -include toolchain/toolchain-buildroot.mk -else ifeq ($(BR2_TOOLCHAIN_EXTERNAL),y) -include toolchain/toolchain-external.mk -endif +include toolchain/*/*.mk # Include the package override file if one has been provided in the # configuration. @@ -387,16 +379,12 @@ $(TARGETS_ALL): __real_tgt_%: $(BASE_TARGETS) % dirs: $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) \ $(HOST_DIR) $(BINARIES_DIR) $(STAMP_DIR) -$(BASE_TARGETS): dirs $(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake - $(BUILD_DIR)/buildroot-config/auto.conf: $(BUILDROOT_CONFIG) $(MAKE) $(EXTRAMAKEARGS) HOSTCC="$(HOSTCC_NOCCACHE)" HOSTCXX="$(HOSTCXX_NOCCACHE)" silentoldconfig prepare: $(BUILD_DIR)/buildroot-config/auto.conf -toolchain: prepare dirs dependencies $(BASE_TARGETS) - -world: toolchain $(TARGETS_ALL) +world: $(BASE_TARGETS) $(TARGETS_ALL) .PHONY: all world toolchain dirs clean distclean source outputmakefile \ legal-info legal-info-prepare legal-info-clean printvars \ diff --git a/toolchain/toolchain/toolchain.mk b/toolchain/toolchain/toolchain.mk new file mode 100644 index 0000000..44ed629 --- /dev/null +++ b/toolchain/toolchain/toolchain.mk @@ -0,0 +1,18 @@ +################################################################################ +# +# toolchain +# +################################################################################ + +TOOLCHAIN_SOURCE = + +ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y) +TOOLCHAIN_DEPENDENCIES += toolchain-buildroot +else ifeq ($(BR2_TOOLCHAIN_EXTERNAL),y) +TOOLCHAIN_DEPENDENCIES += toolchain-external +endif + +$(eval $(generic-package)) + +toolchain-source: prepare dirs dependencies $(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake +