From patchwork Fri Jan 10 10:06:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Porcedda X-Patchwork-Id: 309229 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id 3D9DD2C00B5 for ; Fri, 10 Jan 2014 21:06:28 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 8216093FFD; Fri, 10 Jan 2014 10:06:25 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mTR53GdNzEsr; Fri, 10 Jan 2014 10:06:25 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 9571394049; Fri, 10 Jan 2014 10:06:24 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id AE22A1BFA0B for ; Fri, 10 Jan 2014 10:06:21 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id AB73B93FFD for ; Fri, 10 Jan 2014 10:06:21 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eNBDe9O6KTTB for ; Fri, 10 Jan 2014 10:06:20 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pd0-f179.google.com (mail-pd0-f179.google.com [209.85.192.179]) by hemlock.osuosl.org (Postfix) with ESMTPS id D42E993F6D for ; Fri, 10 Jan 2014 10:06:20 +0000 (UTC) Received: by mail-pd0-f179.google.com with SMTP id y13so1852659pdi.24 for ; Fri, 10 Jan 2014 02:06:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=1fAKF1Y48+ffvhjO0+qocuxBlGtTyXr1aB19PKw4PWk=; b=HQoo3TKch6jlKrzMuMsAWhvksXXRn4bzhW9nUMgDxoy50Z+hqfIv1YPgCCL9WDcVDu HZWjrYy+9be5HDmf2PfhV4CtBxtMS/Ybpn5FrRoH/KE+38+qTeunQnMiSU5pOxMlyHe6 fxk4envzFlAjzX6PzFjw+rUkUXoQ4+loINonJLaUOUr0UykXhdY/gVWxw2cn7/6oAoYT eV8jvz74KXUAgNaSDFJKzcJgtSWfVeoMS0Xqd7GH/Exn47qc+rg12cUA5IzMgbU/f1hr FEC5CDc16Or0mAf1z7ul2UHDf1EJTgKd2/01HfRnSriSk4AWeG7n+2IkBrGcWIvwB92f e6MQ== X-Received: by 10.66.164.70 with SMTP id yo6mr10235759pab.85.1389348380633; Fri, 10 Jan 2014 02:06:20 -0800 (PST) Received: from ld2077.tmt.telital.com ([213.205.6.118]) by mx.google.com with ESMTPSA id ao1sm16161009pbc.18.2014.01.10.02.06.18 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 10 Jan 2014 02:06:20 -0800 (PST) From: Fabio Porcedda To: buildroot@uclibc.org Date: Fri, 10 Jan 2014 11:06:03 +0100 Message-Id: <1389348368-2509-4-git-send-email-fabio.porcedda@gmail.com> X-Mailer: git-send-email 1.8.5.2 In-Reply-To: <1389348368-2509-1-git-send-email-fabio.porcedda@gmail.com> References: <1389348368-2509-1-git-send-email-fabio.porcedda@gmail.com> Cc: Thomas Petazzoni , Dallas Clement Subject: [Buildroot] [PATCH v11 3/8] package: add support for top-level parallel make 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 To be able to use top-level parallel make we must not depend in a rule on the order of evaluation of the prerequisites, so instead of relying on the left to right ordering of evaluation of the prerequisites add an explicit rule to describe the dependencies. We cannot use the pattern rules because they must have the same dependency for every package, but we need to change the dependencies depending on $(2)_OVERRIDE_SRCDIR variable value, so we must use a more flexible way like $(2)_TARGET_% variables. So add explicit dependencies for the following stamp files: $(2)_TARGET_EXTRACT $(2)_TARGET_PATCH $(2)_TARGET_CONFIGURE $(2)_TARGET_BUILD $(2)_TARGET_INSTALL_STAGING $(2)_TARGET_INSTALL_TARGET $(2)_TARGET_INSTALL_IMAGES $(2)_TARGET_INSTALL_HOST Signed-off-by: Fabio Porcedda --- package/glibc/glibc.mk | 6 +++--- package/pkg-generic.mk | 40 +++++++++++++++++++++++----------------- package/uclibc/uclibc.mk | 6 +++--- 3 files changed, 29 insertions(+), 23 deletions(-) diff --git a/package/glibc/glibc.mk b/package/glibc/glibc.mk index 0968f67..3013df3 100644 --- a/package/glibc/glibc.mk +++ b/package/glibc/glibc.mk @@ -38,9 +38,6 @@ GLIBC_ADD_TOOLCHAIN_DEPENDENCY = NO # cross-compiler and the kernel headers GLIBC_DEPENDENCIES = host-gcc-initial linux-headers host-gawk -# Before (e)glibc is built, we must have the second stage cross-compiler -glibc-build: host-gcc-intermediate - GLIBC_SUBDIR = build GLIBC_INSTALL_STAGING = YES @@ -142,3 +139,6 @@ define GLIBC_INSTALL_TARGET_CMDS endef $(eval $(autotools-package)) + +# Before (e)glibc is built, we must have the second stage cross-compiler +$(GLIBC_TARGET_BUILD): | host-gcc-intermediate diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk index 63d3793..ff2d082 100644 --- a/package/pkg-generic.mk +++ b/package/pkg-generic.mk @@ -414,30 +414,37 @@ $(1)-install: $(1)-install-staging $(1)-install-target $(1)-install-images endif ifeq ($$($(2)_INSTALL_TARGET),YES) -$(1)-install-target: $(1)-build \ - $$($(2)_TARGET_INSTALL_TARGET) +$(1)-install-target: $$($(2)_TARGET_INSTALL_TARGET) else $(1)-install-target: endif ifeq ($$($(2)_INSTALL_STAGING),YES) -$(1)-install-staging: $(1)-build \ - $$($(2)_TARGET_INSTALL_STAGING) +$(1)-install-staging: $$($(2)_TARGET_INSTALL_STAGING) else $(1)-install-staging: endif ifeq ($$($(2)_INSTALL_IMAGES),YES) -$(1)-install-images: $(1)-build \ - $$($(2)_TARGET_INSTALL_IMAGES) +$(1)-install-images: $$($(2)_TARGET_INSTALL_IMAGES) else $(1)-install-images: endif -$(1)-install-host: $(1)-build $$($(2)_TARGET_INSTALL_HOST) +$(1)-install-host: $$($(2)_TARGET_INSTALL_HOST) -$(1)-build: $(1)-configure \ - $$($(2)_TARGET_BUILD) +$$($(2)_TARGET_INSTALL_TARGET) $$($(2)_TARGET_INSTALL_STAGING) \ +$$($(2)_TARGET_INSTALL_IMAGES) $$($(2)_TARGET_INSTALL_HOST): \ + $$($(2)_TARGET_BUILD) + +$(1)-build: $$($(2)_TARGET_BUILD) +$$($(2)_TARGET_BUILD): $$($(2)_TARGET_CONFIGURE) + +# The symbol "|" specify a order-only-prerequisite, this is needed for +# phony requisites to avoid rebuilding every time the target. + +$(1)-configure: $$($(2)_TARGET_CONFIGURE) +$$($(2)_TARGET_CONFIGURE): | $$($(2)_DEPENDENCIES) $$($(2)_TARGET_SOURCE) $$($(2)_TARGET_RSYNC): | dirs prepare ifeq ($(filter $(1),$(DEPENDENCIES_HOST_PREREQ)),) @@ -451,13 +458,13 @@ ifeq ($$($(2)_OVERRIDE_SRCDIR),) # extract # patch # configure -$(1)-configure: $(1)-patch $(1)-depends \ - $$($(2)_TARGET_CONFIGURE) +$$($(2)_TARGET_CONFIGURE): $$($(2)_TARGET_PATCH) -$(1)-patch: $(1)-extract $$($(2)_TARGET_PATCH) +$(1)-patch: $$($(2)_TARGET_PATCH) +$$($(2)_TARGET_PATCH): $$($(2)_TARGET_EXTRACT) -$(1)-extract: $(1)-source \ - $$($(2)_TARGET_EXTRACT) +$(1)-extract: $$($(2)_TARGET_EXTRACT) +$$($(2)_TARGET_EXTRACT): $$($(2)_TARGET_SOURCE) $(1)-depends: $$($(2)_DEPENDENCIES) @@ -467,10 +474,9 @@ else # source, by rsyncing # depends # configure -$(1)-configure: $(1)-depends \ - $$($(2)_TARGET_CONFIGURE) +$$($(2)_TARGET_CONFIGURE): $$($(2)_TARGET_RSYNC) -$(1)-depends: $(1)-rsync $$($(2)_DEPENDENCIES) +$(1)-depends: $$($(2)_DEPENDENCIES) $(1)-patch: $(1)-rsync $(1)-extract: $(1)-rsync diff --git a/package/uclibc/uclibc.mk b/package/uclibc/uclibc.mk index 5cd9a46..902c0a2 100644 --- a/package/uclibc/uclibc.mk +++ b/package/uclibc/uclibc.mk @@ -29,9 +29,6 @@ UCLIBC_ADD_TOOLCHAIN_DEPENDENCY = NO # cross-compiler and the kernel headers UCLIBC_DEPENDENCIES = host-gcc-initial linux-headers -# Before uClibc is built, we must have the second stage cross-compiler -uclibc-build: host-gcc-intermediate - # specifying UCLIBC_CONFIG_FILE on the command-line overrides the .config # setting. ifndef UCLIBC_CONFIG_FILE @@ -554,3 +551,6 @@ uclibc-menuconfig: dirs uclibc-patch rm -f $(UCLIBC_DIR)/.stamp_{configured,built,target_installed,staging_installed} $(eval $(generic-package)) + +# Before uClibc is built, we must have the second stage cross-compiler +$(UCLIBC_TARGET_BUILD): | host-gcc-intermediate