From patchwork Wed Mar 6 16:00:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 159755 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp6333330jad; Wed, 6 Mar 2019 08:01:29 -0800 (PST) X-Google-Smtp-Source: APXvYqzuWu8MFbZ4xuiPSoiOt1tdA0gtPfgs8GlLRXG9MrqnkNEFx9kcI1CEMZwq/s3HSi8G2frJ X-Received: by 2002:a63:8948:: with SMTP id v69mr7013009pgd.140.1551888089811; Wed, 06 Mar 2019 08:01:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551888089; cv=none; d=google.com; s=arc-20160816; b=lQZUXfMZ9BRqFjZYbZw4yRkJKFODCwo98JSTo84J/5j54uiruYFY8GlPYJ1O5GzlfW vCbqzBaBsJwK91Thh9dLIs6A3cvA6fdyeMx0FMIg0GPfLjXmq0ElsFsxoA1bRvIVIrSj Hb8AWCgrfiDztfOINJ6v5oEKAjA1vKX4u3/vLqeAGY9vaE1CCXmsmZogSWFkQnDGsrSU oRBsIavHkdq4z+z757tdR9WHZW5om1e/0iqlfrX4BjQUnHXzkU9dH7aegdf3TTiiCHLn jxUuu8RsfOWM8rfyQM968DqZ1f3ljMlBOxrCzadUkLEdupi2AAkDNgkDNlV9A6/SHFrn nuSg== 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=rzANvPh7XYNdT8fbWCbuqmzMaV3KolLp8OdfjmAjmsE=; b=WCA5zk+ps7SJgY7tZ3wt9aiJ7FuVPRezhqpilN+M+0HHeQZWxpo2op3dseVy9aQoRK bir8cKPxZ6jTas9jP1wk+vahUvlnVW/YmSXNBZdVFOvLIYXvMMnXDs8+8wa0ygb3nvDS HSWmKnlEkD+rbYWvEtSS1Ml5XlmA58NaI5WaxXOv00NB0rw0m9T5fcs+E39OVVJoxFXH CFNB6/efpyDCIcN/uS9r7rIfzAheqs4/3tAZuq01PLM/BqkkhQjBKD5ZnnidWEy6f+TU LXxmQ2xNRIBMHmR2qQrPOG3brXRKmpVE0O5P9E6ND4NYP00tt4MC6d0bzFUOOMRUkgy1 bLtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=d4djSLsL; 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 t17si1657973pgg.452.2019.03.06.08.01.29; Wed, 06 Mar 2019 08:01:29 -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=d4djSLsL; 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 S1727302AbfCFQB1 (ORCPT + 31 others); Wed, 6 Mar 2019 11:01:27 -0500 Received: from conuserg-08.nifty.com ([210.131.2.75]:59956 "EHLO conuserg-08.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726270AbfCFQB0 (ORCPT ); Wed, 6 Mar 2019 11:01:26 -0500 Received: from grover.tkatk1.zaq.ne.jp (zaqdadce369.zaq.ne.jp [218.220.227.105]) (authenticated) by conuserg-08.nifty.com with ESMTP id x26G0cMQ009811; Thu, 7 Mar 2019 01:00:39 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com x26G0cMQ009811 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1551888039; bh=rzANvPh7XYNdT8fbWCbuqmzMaV3KolLp8OdfjmAjmsE=; h=From:To:Cc:Subject:Date:From; b=d4djSLsLYf5lmboBlQODP5KPdaAhPXrUcK1UUHNSsWb5owLU5toq7N/1JSpwPnNO4 Bql7dPL7u/ngMD12Eq2ZVr2KAB+JBeFJrrzuCIHGNUDuSvkPbwaeUiaRwP16qHnigz yFNl+oX7xzfRvERww77R5OeJcrMHdxMc1qJWe3HLTCCejj+puN5TUPTTk7T8wLk5UI jDQ21NiYiA1MNj7AlD4XgTftloBYAkKMZzIvke3Gd4h2x/hDYNEJ9DXnJJOtGe2VDX 2g9o29ujTlYQeawUMMuQdbytDQmqGjvTc93Z6af23vzRd/Zp9muB/U3J7Yh72SjNl5 94XToxpTmlehQ== X-Nifty-SrcIP: [218.220.227.105] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Liz Zhang , Lili Deng , Ben Hutchings , Riku Voipio , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH] kbuild: add workaround for Debian make-kpkg Date: Thu, 7 Mar 2019 01:00:35 +0900 Message-Id: <1551888035-13329-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. Looks like Debian Stretch stopped providing make-kpkg (except PowerPC). 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 --- Makefile | 10 ++++++++++ 1 file changed, 10 insertions(+) -- 2.7.4 diff --git a/Makefile b/Makefile index ef4b32c..925d870 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