From df6438f9a726c8f803e03708c83928e439fd5e2f Mon Sep 17 00:00:00 2001 From: Shuah Khan Date: Fri, 21 Apr 2017 16:07:51 -0600 Subject: [PATCH] selftests: lib.mk: define CLEAN macro to allow Makefiles to override clean 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' Fixes: 88baa78d1f31 ("selftests: remove duplicated all and clean target") Signed-off-by: Shuah Khan Acked-by: Michael Ellerman --- 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 775c589ac3c0..959273c3a52e 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) $(OUTPUT)/%:%.c $(LINK.c) $^ $(LDLIBS) -o $@