Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758677AbcDHPhd (ORCPT ); Fri, 8 Apr 2016 11:37:33 -0400 Received: from szxga01-in.huawei.com ([58.251.152.64]:41521 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755464AbcDHPha (ORCPT ); Fri, 8 Apr 2016 11:37:30 -0400 Subject: Re: [PATCH] scripts: Fallback to KBUILD_OUTPUT if O is not specified To: Arnaldo Carvalho de Melo , Thierry Reding References: <1460106849-6435-1-git-send-email-thierry.reding@gmail.com> <20160408145847.GE5327@redhat.com> CC: , Jiri Olsa , "Arnaldo Carvalho de Melo" From: "Wangnan (F)" Message-ID: <5707D022.90002@huawei.com> Date: Fri, 8 Apr 2016 23:37:06 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <20160408145847.GE5327@redhat.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.111.66.109] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020202.5707D029.0079,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 5b17b62e9f65c288ce9e050fbb3665a3 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2171 Lines: 74 On 2016/4/8 22:58, Arnaldo Carvalho de Melo wrote: > Em Fri, Apr 08, 2016 at 11:14:09AM +0200, Thierry Reding escreveu: >> From: Thierry Reding >> >> The KBUILD_OUTPUT environment can be used to set the build directory as >> an alternative to passing the O variable on the command-line. This works >> with regular kernel builds, so it's surprising if it doesn't work within >> the tools/scripts directory. >> >> Allow KBUILD_OUTPUT if O is not specified on the command-line to avoid >> any surprises. > I think this is fine, Jiri, Wang? The idea is fine, but we should be very careful when touching Makefile to avoid breaking build-test like this: # export KBUILD_OUTPUT=/tmp/xxxxx # ./tests/perf-targz-src-pkg . PERF_VERSION = 4.5.g337b7b ls: cannot access perf-*.tar.gz: No such file or directory tar: -C: Cannot open: No such file or directory tar: Error is not recoverable: exiting now make: *** /tmp/tmp.q4egWrFd3L/perf*/tools/perf: No such file or directory. Stop Moreover, in the above case, the output directory should be /tmp/xxxxx or /tmp/xxxxx/tools/perf ? Since kernel build output things to /tmp/xxxxx, I think we'd better output to /tmp/xxxxx/tools/perf. Thank you. > - Arnaldo > >> Signed-off-by: Thierry Reding >> --- >> Hi Arnaldo, >> >> I'm not sure if you're the right person to send this to. There was noone >> reported by scripts/get_maintainer.pl, but it looks like you ended up >> applying most of the patches to this file lately, which kinda makes you >> the de facto maintainer =). >> >> Thierry >> >> tools/scripts/Makefile.include | 4 ++++ >> 1 file changed, 4 insertions(+) >> >> diff --git a/tools/scripts/Makefile.include b/tools/scripts/Makefile.include >> index 8abbef164b4e..5467da41dc72 100644 >> --- a/tools/scripts/Makefile.include >> +++ b/tools/scripts/Makefile.include >> @@ -8,6 +8,10 @@ ifeq ($(objtree),) >> objtree := $(O) >> endif >> endif >> +else >> +ifneq ($(KBUILD_OUTPUT),) >> + OUTPUT := $(KBUILD_OUTPUT)/$(if $(subdir),$(subdir)/) >> +endif >> endif >> >> # check that the output directory actually exists >> -- >> 2.8.0