From patchwork Fri Mar 8 09:13:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 159961 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp8471698jad; Fri, 8 Mar 2019 01:15:32 -0800 (PST) X-Google-Smtp-Source: APXvYqyGfr4I4MkWsu2bQoFcAm9zBm0+GTC7fo0aarXbGyHqoJdEj6ewii/EIxhvxRKIGj0oKldr X-Received: by 2002:a17:902:aa90:: with SMTP id d16mr17117417plr.250.1552036532502; Fri, 08 Mar 2019 01:15:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1552036532; cv=none; d=google.com; s=arc-20160816; b=ztN8qJU8amvgkLs4YDWi/BNPzj9PqZwH1qfsV/5llvyFld8VSmfHGla17S14nGFpi5 14ea3E3NDrsI9zcdvHer/O9kSEuoVsHvS0k+142iYhk+xeuzE/q4OVJzwrSucS2NH936 OD9dHolkNjgkgzmkuVOznrWLXlH5byr0AveqP1FulsIU0DcjKLzbR7G4uJtQE9cgLC/j qXBnx/6gE3QwDJEl/nCLIBhYbs3iksywC1yM0r35vO3h1a3zLMLZEKpFj+GfZxd8PmHm v19bZ4sFx9B+dsc9r8Zsrwmt/V23c0DoTagewNyt42MPyKWHJihOoqCFd7Mi6M6Vr8jY ICJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=J5g9Gfl4sCC+dbt4osgG8WcQH8Dej03T5AiuXdbjW60=; b=SkRd1A21IOQDjzNyHsY81oIuP9yR1nP7fXmyY/mHv9BUBnBWBWfeUNOCV26R8jSv8V px/XsaQaiSIa4cKx071cY+4iXjTia+m9Som7UiaOY1LPH0YSglDJrVQOKakYQz2+fhYi zdb5M2Jv+MCkSvfpqBl2gVw2uet3J7j3MsbykciytemKdjJ9u4MZDbzzeogLDJsgkmuf qjsXD5b81bW/thXJRDZyierOB8Wv75RMtZeiFS8wipi2Jq+sBjsj7+HyFOlI/P9pn9jV SE8v4gxJ+gPealMMqtNqZeJqixGJhhRwzNwggPsoY4vGPLkuT54c2h8SLT4dUPjqhd5h g3Tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b="M/jOhf7u"; 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 89si6584864pld.153.2019.03.08.01.15.32; Fri, 08 Mar 2019 01:15:32 -0800 (PST) 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="M/jOhf7u"; 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 S1726525AbfCHJPa (ORCPT + 31 others); Fri, 8 Mar 2019 04:15:30 -0500 Received: from conuserg-09.nifty.com ([210.131.2.76]:41836 "EHLO conuserg-09.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725975AbfCHJP0 (ORCPT ); Fri, 8 Mar 2019 04:15:26 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-09.nifty.com with ESMTP id x289Dgtg011034; Fri, 8 Mar 2019 18:13:42 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com x289Dgtg011034 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1552036423; bh=J5g9Gfl4sCC+dbt4osgG8WcQH8Dej03T5AiuXdbjW60=; h=From:To:Cc:Subject:Date:From; b=M/jOhf7ucJAEYTxn4QTduKP1KjtoFFGRTB6lWFmldLNrb4IOZJcHcVfwJopb5UKoy 73Ly87ZznBGG41GZ5Mrp3YkmwAWkL7C433wSvvhZewD01QLWMqzcs+xmn3va/RJs6c 1sSK1dMm1KA9A2mjDgas20pfMqGA6BhgcVXnV1cDbYEVdeDu+9tTf2HmI6rJ4q+gZj fMNIJ45l2M3Uf/zkoaz7lLT49YhsG/Tp+XkDaZyIC9L5keHL0qD3Szs/9EXj/qB+9E rORiStlYu6mkjVfTCRhoIbowl8hQ8rcW20AZa8zdRtoSmmjPUd2xwp+Vrb/U9EuF+1 6BJYM4idTAkZA== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Ben Hutchings , Riku Voipio , Manoj Srivastava , Liz Zhang , Lili Deng , Manoj Srivastava , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH v2] kbuild: add workaround for Debian make-kpkg Date: Fri, 8 Mar 2019 18:13:39 +0900 Message-Id: <1552036419-924-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- Changes in v2: - Drop the unimportant comment about PowerPC Makefile | 10 ++++++++++ 1 file changed, 10 insertions(+) -- 2.7.4 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