From patchwork Tue Jun 2 10:46:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Porcedda X-Patchwork-Id: 479394 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 029D6140E5E for ; Tue, 2 Jun 2015 20:46:12 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=m64BK+b9; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 0DC5395020; Tue, 2 Jun 2015 10:46:11 +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 LwCgpf68-UHD; Tue, 2 Jun 2015 10:46:08 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id AD0EB9501C; Tue, 2 Jun 2015 10:46:08 +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 CF24A1C0FB2 for ; Tue, 2 Jun 2015 10:46:06 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id CAEABA3F50 for ; Tue, 2 Jun 2015 10:46:06 +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 u9t2LPeTgE-S for ; Tue, 2 Jun 2015 10:46:05 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wi0-f179.google.com (mail-wi0-f179.google.com [209.85.212.179]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 29081A3E61 for ; Tue, 2 Jun 2015 10:46:05 +0000 (UTC) Received: by wibdq8 with SMTP id dq8so54828028wib.1 for ; Tue, 02 Jun 2015 03:46:03 -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=taZdChDfa+lBM8l6nAEiUY1GADGVqzDcSbWMk0yIeB0=; b=m64BK+b915iaWO+Ykosd+DstI57/cawDbQgxD0+rN6GW6gp4Qare+gukyRWo0jCtEq SZIWoShowwYpqYd9jQOkIPNwd3ENwqQ8TEBR6aW6Czw+bWAx2YcTChDWSub8nJZ0kQMx A8QtZtHe7yuNeGxfX8OxwLG7q8Dh2EaKofEfI1y7RhCYsRqCwR63aGbBBoLd2Sle2Yxh DoCN1vLz6hXeO4QBAg0pdUMPu1J9RPoLXry1kvxIlEWKL4mnK/wn/jw+gfkfPkuREjFG 6lngxbILnjqM8zZADy58cNPGYKAIDEJtm5wIyFE76Vr/FZL3FWVKXTkZQCyIRAUuQYBU W6XQ== X-Received: by 10.180.160.169 with SMTP id xl9mr30025054wib.42.1433241963429; Tue, 02 Jun 2015 03:46:03 -0700 (PDT) Received: from beast.localdomain (dynamic-adsl-84-221-128-105.clienti.tiscali.it. [84.221.128.105]) by mx.google.com with ESMTPSA id ma15sm12421814wic.20.2015.06.02.03.46.02 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Jun 2015 03:46:02 -0700 (PDT) From: Fabio Porcedda To: buildroot@uclibc.org Date: Tue, 2 Jun 2015 12:46:01 +0200 Message-Id: <1433241961-16445-1-git-send-email-fabio.porcedda@gmail.com> X-Mailer: git-send-email 2.4.1 Subject: [Buildroot] [PATCH v3] 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 43b5ba5..9f82c6d 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 a0c5a7a..55c65f2 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))