From patchwork Thu Aug 22 04:46:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 171995 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp361836ily; Wed, 21 Aug 2019 21:46:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqzUM5n49MLjCP3tyaYn4ggNWnSz0pmXtS4Y+oZSqt9654xoePU4OQz0w6O81Irypy5Llxwc X-Received: by 2002:aa7:82da:: with SMTP id f26mr39762893pfn.82.1566449195621; Wed, 21 Aug 2019 21:46:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566449195; cv=none; d=google.com; s=arc-20160816; b=FRhGZ6s0CJ7UWRfb+GM2sNXRxuI5CEt4QbTRU2bpHqoVyGUTbCrvXa+5TRPQ+d95jh l4XFmdbR+uq6YhCsH2RHx+C2Jddzou8gILDjV6gXeOQSn8cDwjtPIbFK3yj/0X0ySrtJ 0IYUvVa4tb7xSFOnTsC/qdYO30GyLxAevLgQGOYLJCEQzraa4540iqjFAJNg/f1Mhm2Y VYRoyBaAFGExsH8DcgoFIykBxFujFLBq6ROyQeb4aFP6cXtBieHkC5Vlge06/ZB3voll pjAE8nqTKECcXvCydHFnzRWYX6A3mB9cHEZaiG6OtSpONHBB2bHYny2JO7x82Golthdh 6auQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=6gGU+zbwAmmeHsHvPATXUaYKglga5VDWoX8vHpWidI4=; b=sHqQacHGfhUiln2c479GsaFUgHhMKebrCoKTTzQNrkOOE+4KpTlhevnDbRBLVrvdIv 7xD3fxRNYr+FieXNth8/ZXH/EGHvMQW4zNt/IzfyqUUEVUkQ6lCSJTixwaPBctvUFNg3 2EIDSKs4IEmnfP13Sj17P+dsu4EST0gruR/XHyTiINv26/fvmt+WHwuzt87jwlWWxikj XR6g9aCUqXo5WY+Om7XIH5f8EqLUP+pMos4mfht0RqfhIU0D88iJkDbEVdg3HTkMTxNv a6bwI9REfAONiIcV5thNMPLpgNaHDoGduGSf3xtuksvrvw1YYg97mun876rtGyJGPCx4 3xRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=NmGd4YJx; 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 z11si1529909pju.108.2019.08.21.21.46.35; Wed, 21 Aug 2019 21:46:35 -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=NmGd4YJx; 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 S1730989AbfHVEq3 (ORCPT + 28 others); Thu, 22 Aug 2019 00:46:29 -0400 Received: from conuserg-07.nifty.com ([210.131.2.74]:29723 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728801AbfHVEq3 (ORCPT ); Thu, 22 Aug 2019 00:46:29 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-07.nifty.com with ESMTP id x7M4kEYi001492; Thu, 22 Aug 2019 13:46:17 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com x7M4kEYi001492 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1566449177; bh=6gGU+zbwAmmeHsHvPATXUaYKglga5VDWoX8vHpWidI4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NmGd4YJx5J+5TUl1R1UL9Y/DVXvmYu6opIM6HB/+xW3Y9YWmkcmiSmX6V3g3QbFor rnQgKCZrhbpzJQVuCxOx4WOGLuXxNulHev9cmczPQNy3KJ36dlbg6tesPpvtXHoQ38 VtjkmlSZATC6+5IgLPgTY21FzmFWg3876Bq8ITzXVX7hWsGue+Lvq+pfOAoOwfhBnP TuTAcBAgG9pKrcJX2tUNV4lgTIqmxQ8iCFerL4aThscs8OpxK9x2sYWq38KI0Oe5/h TJjo0yD3DzHuQNLpO592JNa4GucanHCTq4ofYosEF824drgC9O2Sesxs8pmSYIwYpL la+UP+JL6ZnbQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Geert Uytterhoeven , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH 4/6] kbuild: move the clean srctree check to the outputmakefile target Date: Thu, 22 Aug 2019 13:46:11 +0900 Message-Id: <20190822044613.5349-4-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190822044613.5349-1-yamada.masahiro@socionext.com> References: <20190822044613.5349-1-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org With this commit, the error report is shown earlier, even before running kconfig. Signed-off-by: Masahiro Yamada --- Makefile | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) -- 2.17.1 diff --git a/Makefile b/Makefile index 901fcb8fffbe..ca6851f5ebc9 100644 --- a/Makefile +++ b/Makefile @@ -522,6 +522,7 @@ scripts_basic: $(Q)rm -f .tmp_quiet_recordmcount PHONY += outputmakefile +# 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. @@ -529,6 +530,15 @@ PHONY += outputmakefile # ignore whole output directory outputmakefile: ifdef building_out_of_srctree + $(Q)if [ -f $(srctree)/.config -o \ + -d $(srctree)/include/config -o \ + -d $(srctree)/arch/$(SRCARCH)/include/generated ]; then \ + echo >&2 "***"; \ + echo >&2 "*** The source tree is not clean, please run 'make$(if $(findstring command line, $(origin ARCH)), ARCH=$(ARCH)) mrproper'"; \ + echo >&2 "*** in $(abs_srctree)";\ + echo >&2 "***"; \ + false; \ + fi $(Q)ln -fsn $(srctree) source $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkmakefile $(srctree) $(Q)test -e .gitignore || \ @@ -1113,21 +1123,7 @@ scripts: scripts_basic scripts_dtc PHONY += prepare archprepare prepare3 -# prepare3 is used to check if we are building in a separate output directory, -# and if so do: -# 1) Check that make has not been executed in the kernel src $(srctree) prepare3: include/config/kernel.release -ifdef building_out_of_srctree - $(Q)if [ -f $(srctree)/.config -o \ - -d $(srctree)/include/config -o \ - -d $(srctree)/arch/$(SRCARCH)/include/generated ]; then \ - echo >&2 "***"; \ - echo >&2 "*** The source tree is not clean, please run 'make$(if $(findstring command line, $(origin ARCH)), ARCH=$(ARCH)) mrproper'"; \ - echo >&2 "*** in $(abs_srctree)";\ - echo >&2 "***"; \ - /bin/false; \ - fi; -endif archprepare: archheaders archscripts scripts prepare3 outputmakefile \ asm-generic $(version_h) $(autoksyms_h) include/generated/utsrelease.h