Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp83950pxj; Wed, 26 May 2021 16:54:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyxzVaxobc8jlkfEmFlpAqKgEm0m/1l+p8y/eQPum7Xc8UYrqEnlxikJFKe4XfmRu3YpJ8k X-Received: by 2002:aa7:d413:: with SMTP id z19mr833759edq.37.1622073293683; Wed, 26 May 2021 16:54:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622073293; cv=none; d=google.com; s=arc-20160816; b=jHGVm+QulTA1zkv+1hdnLEgj8jZNqVA51ePxrdxxP5sz35lUCyRob+fmq+mxgic3Ki cWc8JQ5OQG3Ppg+gRtnFOGPhT5GP6I84vFxlTtQF7qepm4tF/PG2RyuabiSe2CPqfJiQ AueX4B+fdVMaHsBMtN+uZ+ckifVtXo8JpKZksWJzTQzyrAUByAWD6TYVfnuwBEvErV4T 715QNihMAXhB8cvM7Lmg/NRc4h42nebFGNFCsjSJ5GoiMyvhonI9yxc1vHlJO9Rwvo+2 jZWXRZ3u9z4Uh15lNP8F3ob7SPXYMWCx6B+3M/C9KwYHpWliUVe+uPnxQ/UMAHvLRrLX xuHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature:dkim-signature; bh=ZUa2ajN4n6dAwvXL49SJ79dqRohBxVCl8r/IG+iC/fU=; b=dCiBK/ZhrQSGx45slzcmFLTwogaSr8opGcGyY8NeQrdFH2eSYzsgYTKsP7iKvE2sj9 NL9e9W55e+MVA5W+ZiVQnwHYH7MiUr8Ce3E/HJ2dSLZTl0p+DAavOie9CrihM0Ek3Lje AmexJStj6ZMeIwft0D+XNHr/nz+LnOuDMy7Y3N4AKAe2gQmHPP09GvTFrXiRS4C9yr4g yuWaacrLuG7mq+Wx3wKSSR36iLkD3avUObpC+JrquN6v+zmTqoM7on9iZhN7VVP1n5rx 9NR2zfS20NWzaHU7fNYFA1HZLyiRxhINlW6ItYXosPqc6/A09zhYdNU7v+y9/9yR3MpW Tytg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=mUXykzBE; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=OJQgvRAT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dh1si350608edb.564.2021.05.26.16.54.29; Wed, 26 May 2021 16:54:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=mUXykzBE; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=OJQgvRAT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234472AbhEZRkw (ORCPT + 99 others); Wed, 26 May 2021 13:40:52 -0400 Received: from mx2.suse.de ([195.135.220.15]:46854 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234588AbhEZRkl (ORCPT ); Wed, 26 May 2021 13:40:41 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1622050748; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=ZUa2ajN4n6dAwvXL49SJ79dqRohBxVCl8r/IG+iC/fU=; b=mUXykzBEyqbkEOhnt5txnbxEf9w16hbJU6BR5Ke41oG+yFwASYY8Ita7gLkZ8CNHtPNkzn j2+WCUj1lcTTGeLiNboRBf+O+mslTZ59nXfnR5fQlIR6eeJkAQjc4URQr5dc5IgwmQZh3P GLsGEsLVFsvLVogpK48JbvmyINrDfcw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1622050748; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=ZUa2ajN4n6dAwvXL49SJ79dqRohBxVCl8r/IG+iC/fU=; b=OJQgvRATxY9RlOYacjyxcAAybTFR5FOWQzeE+te70+8Uodl/5AsxrnwPpXpHx3MmlwjJiT KriRUWRT0ccjHBBQ== Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 8B7A2AEB3; Wed, 26 May 2021 17:39:08 +0000 (UTC) From: Michal Suchanek To: linux-kbuild@vger.kernel.org Cc: Michal Suchanek , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH] Revert "kbuild: merge scripts/mkmakefile to top Makefile" Date: Wed, 26 May 2021 19:38:55 +0200 Message-Id: <20210526173855.5963-1-msuchanek@suse.de> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This reverts commit 243b50c141d71fcf7b88e94474b3b9269f0b1f9d. When packaging the kernel it is built in different place from the one in which it will be installed. After build the makefile needs to be regenerated with the target location but with mkmakefile merged into Makefile tehre is no way to do that. Signed-off-by: Michal Suchanek --- Makefile | 15 +++------------ scripts/mkmakefile | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 12 deletions(-) create mode 100755 scripts/mkmakefile diff --git a/Makefile b/Makefile index 58b086b30144..462899c1b5d7 100644 --- a/Makefile +++ b/Makefile @@ -573,24 +573,14 @@ scripts_basic: $(Q)rm -f .tmp_quiet_recordmcount PHONY += outputmakefile -ifdef building_out_of_srctree # Before starting out-of-tree build, make sure the source tree is clean. # outputmakefile generates a Makefile in the output directory, if using a # separate output directory. This allows convenient use of make in the # output directory. # At the same time when output Makefile generated, generate .gitignore to # ignore whole output directory - -quiet_cmd_makefile = GEN $@ - cmd_makefile = { \ - echo "\# Automatically generated by $(srctree)/Makefile: don't edit"; \ - echo "include $(srctree)/Makefile"; \ - } > $@ - -Makefile: FORCE - $(call cmd,makefile) - -outputmakefile: Makefile +outputmakefile: +ifdef building_out_of_srctree $(Q)if [ -f $(srctree)/.config -o \ -d $(srctree)/include/config -o \ -d $(srctree)/arch/$(SRCARCH)/include/generated ]; then \ @@ -601,6 +591,7 @@ outputmakefile: Makefile false; \ fi $(Q)ln -fsn $(srctree) source + $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkmakefile $(srctree) $(Q)test -e .gitignore || \ { echo "# this is build directory, ignore it"; echo "*"; } > .gitignore endif diff --git a/scripts/mkmakefile b/scripts/mkmakefile new file mode 100755 index 000000000000..1cb174751429 --- /dev/null +++ b/scripts/mkmakefile @@ -0,0 +1,17 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0 +# Generates a small Makefile used in the root of the output +# directory, to allow make to be started from there. +# The Makefile also allow for more convinient build of external modules + +# Usage +# $1 - Kernel src directory + +if [ "${quiet}" != "silent_" ]; then + echo " GEN Makefile" +fi + +cat << EOF > Makefile +# Automatically generated by $0: don't edit +include $1/Makefile +EOF -- 2.26.2