Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp3178587imc; Wed, 13 Mar 2019 10:47:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqyyTP2ZfnWurN94n/Ksr/R407tJpb9pONKqa6qDqgJQWEOgO7Lr8s0Buz4Hecv1KDQocqhT X-Received: by 2002:a63:581c:: with SMTP id m28mr5544853pgb.332.1552499232446; Wed, 13 Mar 2019 10:47:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552499232; cv=none; d=google.com; s=arc-20160816; b=UbH76r3jrhiiO6BjL9BSa1Mxi50h4exl9WZ07EVU2cM/TSY34tCL0+5enhxq5+w1s7 AwTZOPSMZDWbi1KZYndXDBgxQ6Zy1oTPHEh85oKp3xuGqskZ8Uik5TuliVrqPP0/cwv9 3zBUzz9fT4Ht3Le4k4WhffLvWDro0wwwrDqMf0+FopCUs7nlntU5o9hHVJ0Tdlq+qusy sCZL3G1ZOMXBBan6Hq1WXrAw0Ggwemurw3/nfjfTnaC4icytVSe8AwzybpSoJXcvHXOb ovqGfUIQM9SLjFikK++y7/TOp9S66D0lByiG6prj2nlOr4p3PKy/T6MJVtHwPib2qk1J gl+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature:dkim-filter; bh=AbMSZAUcqIEOIgIxxaDhD7RBuUY6Me8iIIfws+TqVuA=; b=g25R2xmfik9Tl/5wQQpI7qWW2fZJW/Jun8h7qh/AJYPN6s40gMPM67uvBrWbNAmIuD NXlFfld5pEUN31wLUvNxO7WpTBOVFB1knaxaOk9JY2gUJvJrUyoJez9UaeS6tdvagd+m Lt2e5TOkAC0u6CUhZgTbiKXWldBK6q6cxPTrTZagOLX+kJMuCbnuzE2JXioXD4PGX3Hb xJdENebi97fLTz/GwXCVQpYK+4CD6Fxl7BR16bjg3JAEDo192iRQOCw+BAMt1hbg+T1O BHFxdEpFnBbJgC1Y+MwJ5+4djo7ZSaumo2nEZj0D7ZMUf1nfPUu25zsmI2L+jSklvRD1 jRvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=xc9klXTw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r24si10588778pgg.466.2019.03.13.10.46.56; Wed, 13 Mar 2019 10:47:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=xc9klXTw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726927AbfCMRpn (ORCPT + 99 others); Wed, 13 Mar 2019 13:45:43 -0400 Received: from conssluserg-04.nifty.com ([210.131.2.83]:37516 "EHLO conssluserg-04.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725876AbfCMRpn (ORCPT ); Wed, 13 Mar 2019 13:45:43 -0400 Received: from mail-vs1-f48.google.com (mail-vs1-f48.google.com [209.85.217.48]) (authenticated) by conssluserg-04.nifty.com with ESMTP id x2DHjWsT018607; Thu, 14 Mar 2019 02:45:32 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-04.nifty.com x2DHjWsT018607 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1552499132; bh=AbMSZAUcqIEOIgIxxaDhD7RBuUY6Me8iIIfws+TqVuA=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=xc9klXTwj/e0ByIWTwoIChOPPlSyvYORjPgCu98PQHZ0kC4PvnganWqnrl5BpGP1A Jro/IiAxw/6yANi961f1nM1QgmATaguY7UUPJJplbum9+A9YRnrk2VMQLW0pE8OW6M pnISVEbD75bYoG11hG/6EUjjTD3quZn5wFzMg0H6YtP+nimWNihZxlErijv0wTgxcK Qc0PLe8SQkrPQNIie351hbyeCzmkxFgGcBYVFH1Hi7A8f9hq7naqWsYsKgGsB318ff xGSXyh1KjDbcy/TKJxCXYHWT6fnyERwCeZmvUo8MU63N+FPpk4mdAu3GeuTPQgG6L8 MXQCjiwRaaRJQ== X-Nifty-SrcIP: [209.85.217.48] Received: by mail-vs1-f48.google.com with SMTP id y19so1549981vsc.4; Wed, 13 Mar 2019 10:45:32 -0700 (PDT) X-Gm-Message-State: APjAAAU6NdQY2sX9+ib03llCZk1vYYTAaOb6c9uubc5FDvNluhG7VujA WkB7SZFp4fL62zMFx3Eh5a/ccFq+bJBmDLf+zGo= X-Received: by 2002:a67:f90e:: with SMTP id t14mr23702454vsq.181.1552499131604; Wed, 13 Mar 2019 10:45:31 -0700 (PDT) MIME-Version: 1.0 References: <1552036419-924-1-git-send-email-yamada.masahiro@socionext.com> In-Reply-To: <1552036419-924-1-git-send-email-yamada.masahiro@socionext.com> From: Masahiro Yamada Date: Thu, 14 Mar 2019 02:44:55 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] kbuild: add workaround for Debian make-kpkg To: Linux Kbuild mailing list Cc: Ben Hutchings , Riku Voipio , Manoj Srivastava , Liz Zhang , Lili Deng , Manoj Srivastava , Michal Marek , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 8, 2019 at 6:15 PM Masahiro Yamada wrote: > > Since commit 3812b8c5c5d5 ("kbuild: make -r/-R effective in top > Makefile for old Make versions"), make-kpkg is not working. > > make-kpkg directly includes the top Makefile of Linux kernel, and > appends some debian_* targets. > > /usr/share/kernel-package/ruleset/kernel_version.mk: > > # Include the kernel makefile > override dot-config := 1 > include Makefile > dot-config := 1 > > I did not know the kernel Makefile was used in that way, and it is > hard to guarantee the behavior when the kernel Makefile is included > by another Makefile from a different project. > > It looks like Debian Stretch stopped providing make-kpkg. Maybe it is > obsolete and being replaced with 'make deb-pkg' etc. but still widely > used. > > This commit adds a workaround; if the top Makefile is included by > another Makefile, skip sub-make in order to make the main part visible. > 'MAKEFLAGS += -rR' does not become effective for GNU Make < 4.0, but > Debian/Ubuntu is already using newer versions. > > The effect of this commit: > > Debian 8 (Jessie) : Fixed > Debian 9 (Stretch) : make-kpkg (kernel-package) is not provided > Ubuntu 14.04 LTS : NOT Fixed > Ubuntu 16.04 LTS : Fixed > Ubuntu 18.04 LTS : Fixed > > This commit cannot fix Ubuntu 14.04 because it installs GNU Make 3.81, > but its support will end in Apr 2019, which is before the Linux v5.1 > release. > > I added warning so that nobody would try to include the top Makefile. > > Fixes: 3812b8c5c5d5 ("kbuild: make -r/-R effective in top Makefile for old Make versions") > Reported-by: Liz Zhang > Signed-off-by: Masahiro Yamada > Tested-by: Lili Deng > Cc: Manoj Srivastava > --- Applied to linux-kbuild. > Changes in v2: > - Drop the unimportant comment about PowerPC > > Makefile | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/Makefile b/Makefile > index 4fb8896..6039685 100644 > --- a/Makefile > +++ b/Makefile > @@ -31,6 +31,16 @@ _all: > # descending is started. They are now explicitly listed as the > # prepare rule. > > +# Ugly workaround for Debian make-kpkg: > +# make-kpkg directly includes the top Makefile of Linux kernel. In such a case, > +# skip sub-make to support debian_* targets in ruleset/kernel_version.mk, but > +# displays warning to discourage such abusage. > +ifneq ($(word 2, $(MAKEFILE_LIST)),) > +$(warning Do not include top Makefile of Linux Kernel) > +sub-make-done := 1 > +MAKEFLAGS += -rR > +endif > + > ifneq ($(sub-make-done),1) > > # Do not use make's built-in rules and variables > -- > 2.7.4 > -- Best Regards Masahiro Yamada