From patchwork Mon Apr 6 13:50:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Porcedda X-Patchwork-Id: 458382 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 90316140280 for ; Mon, 6 Apr 2015 23:50:16 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="verification failed; unprotected key" header.d=gmail.com header.i=@gmail.com header.b=RSQFvd1T; dkim-adsp=none (unprotected policy); dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id B1BE9A1744; Mon, 6 Apr 2015 13:50:15 +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 wcZDpBfj_Y6o; Mon, 6 Apr 2015 13:50:14 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id AB108A1739; Mon, 6 Apr 2015 13:50:14 +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 87DA51C1E62 for ; Mon, 6 Apr 2015 13:50:13 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 837F62CDD6 for ; Mon, 6 Apr 2015 13:50:13 +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 BQtF+EhCxCFq for ; Mon, 6 Apr 2015 13:50:12 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com [209.85.212.174]) by silver.osuosl.org (Postfix) with ESMTPS id 717E027526 for ; Mon, 6 Apr 2015 13:50:12 +0000 (UTC) Received: by widjs5 with SMTP id js5so22150637wid.1 for ; Mon, 06 Apr 2015 06:50:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id; bh=ZX5EhAZEhgem8KSZdUv+1/+piOnM4numuD1/DAjrLvs=; b=RSQFvd1TtMoezt5da8jEUJHB+xv8O3SKiXkx1U/6v02MYV6VGfjfRGkzf59dKDwcD+ YL/H1MgLc6wDzX71ghUMbhLbdPhJlGSAU1eAqBdR3KFgJOBCNgOQIv6EM/pj8TdKVewL oIzTzHTeL9UkZ5g8XeYCUPWAER8BeRpM/rMBo1GNqnQ2uoU2oqzK0DOgkNFGOsqZvIqJ DdueCJQo6f2ATMMTjMbF871ROdoGUF46ilLFAMP2y938slI3BbWjXGieqfi6Y+dl8Ccq VYxq1SSaJ1RSaUj7jXF8fUBZJbvMn/eJrsh9k2wz17tS1xJmc+qmIut2q0vj6g12VKka afOg== X-Received: by 10.181.9.98 with SMTP id dr2mr57763044wid.62.1428328210920; Mon, 06 Apr 2015 06:50:10 -0700 (PDT) Received: from beast.localdomain (dynamic-adsl-84-221-131-243.clienti.tiscali.it. [84.221.131.243]) by mx.google.com with ESMTPSA id k2sm6620741wif.3.2015.04.06.06.50.09 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Apr 2015 06:50:10 -0700 (PDT) From: Fabio Porcedda To: buildroot@uclibc.org Date: Mon, 6 Apr 2015 15:50:08 +0200 Message-Id: <1428328208-27211-1-git-send-email-fabio.porcedda@gmail.com> X-Mailer: git-send-email 2.3.4 Subject: [Buildroot] [PATCH] packages: fix and improve support for top-level parallel makefile X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 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" To fix packages that fail to build when PARALLEL_JOBS is empty instead of using an empty PARALLEL_JOBS just avoid to using it in the MAKE variable. Check the MAKEFLAGS variable to know automatically if the -j option is being used, but use the "=" operator instead of the ":=" operator because it can be checked only in a "recursively expanded variable". Use "override" because otherwise it's impossible to change the automatic variable "MAKE". Signed-off-by: Fabio Porcedda Acked-by: Arnout Vandecappelle (Essensium/Mind) --- Makefile | 4 ++-- package/Makefile.in | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 8d09725..6c2dcca 100644 --- a/Makefile +++ b/Makefile @@ -58,8 +58,8 @@ export HOSTARCH := $(shell uname -m | \ # # Taking into account the above considerations, if you still want to execute # this top-level Makefile in parallel comment the ".NOTPARALLEL" line and -# build using the following command: -# make BR2_JLEVEL= -j$((`getconf _NPROCESSORS_ONLN`+1)) +# use the -j option when building, e.g: +# make -j$((`getconf _NPROCESSORS_ONLN`+1)) .NOTPARALLEL: # absolute path diff --git a/package/Makefile.in b/package/Makefile.in index fc57427..ed68e35 100644 --- a/package/Makefile.in +++ b/package/Makefile.in @@ -18,7 +18,8 @@ PARALLEL_JOBS := $(BR2_JLEVEL) endif MAKE1 := $(HOSTMAKE) -j1 -MAKE := $(HOSTMAKE) $(if $(PARALLEL_JOBS),-j$(PARALLEL_JOBS)) +override MAKE = $(HOSTMAKE) \ + $(if $(findstring j,$(filter-out --%,$(MAKEFLAGS))),,-j$(PARALLEL_JOBS)) ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y) TARGET_VENDOR = $(call qstrip,$(BR2_TOOLCHAIN_BUILDROOT_VENDOR))