From mboxrd@z Thu Jan 1 00:00:00 1970 From: Shuah Khan Subject: Re: [PATCH 2/8] selftests: lib.mk: define CLEAN macro to allow Makefiles to override clean Date: Mon, 24 Apr 2017 13:46:23 -0600 Message-ID: <8845c13f-eaeb-86a1-1ac8-d7c52e934ef4@kernel.org> References: <063D6719AE5E284EB5DD2968C1650D6DCFFD98E2@AcuExch.aculab.com> Reply-To: shuah@kernel.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Return-path: In-Reply-To: <063D6719AE5E284EB5DD2968C1650D6DCFFD98E2@AcuExch.aculab.com> Sender: linux-kernel-owner@vger.kernel.org To: David Laight , 'Shuah Khan' , "bamvor.zhangjian@linaro.org" , "benh@kernel.crashing.org" , "paulus@samba.org" , "mpe@ellerman.id.au" , "dvhart@infradead.org" Cc: "linux-kselftest@vger.kernel.org" , "rkrcmar@redhat.com" , "dsafonov@virtuozzo.com" , "dave.hansen@linux.intel.com" , "linux-kernel@vger.kernel.org" , "emilio.lopez@collabora.co.uk" , "linux-gpio@vger.kernel.org" , "viro@zeniv.linux.org.uk" , "luto@kernel.org" , "linuxppc-dev@lists.ozlabs.org" , "mingo@kernel.org" , Shuah Khan List-Id: linux-gpio@vger.kernel.org On 04/24/2017 09:45 AM, David Laight wrote: > From: Shuah Khan >> Sent: 22 April 2017 00:15 >> Define CLEAN macro to allow Makefiles to override common clean target >> in lib.mk. This will help fix the following failures: >> >> warning: overriding recipe for target 'clean' >> ../lib.mk:55: warning: ignoring old recipe for target 'clean' >> >> Signed-off-by: Shuah Khan >> --- >> tools/testing/selftests/lib.mk | 6 +++++- >> 1 file changed, 5 insertions(+), 1 deletion(-) >> >> diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk >> index 775c589..959273c 100644 >> --- a/tools/testing/selftests/lib.mk >> +++ b/tools/testing/selftests/lib.mk >> @@ -51,8 +51,12 @@ endef >> emit_tests: >> $(EMIT_TESTS) >> >> -clean: >> +define CLEAN >> $(RM) -r $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES) $(EXTRA_CLEAN) >> +endef >> + >> +clean: >> + $(CLEAN) > > If might be easier to do something like: > > ifneq($(NO_CLEAN),y) > clean: > $(RM) -r $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES) $(EXTRA_CLEAN) > endif > > David > I am not sure that it is easier. Defining a macro would work well in this case to override and also works well with what we are doing for other overrides we already have such as EMIT_TESTS. thanks, -- Shuah