Introduce OVERRIDE_TARGETS to allow tests to express dependencies on header files and .so, which require to override the selftests lib.mk targets.
Signed-off-by: Mathieu Desnoyers mathieu.desnoyers@efficios.com Acked-by: Shuah Khan shuahkh@osg.samsung.com CC: Russell King linux@arm.linux.org.uk CC: Catalin Marinas catalin.marinas@arm.com CC: Will Deacon will.deacon@arm.com CC: Thomas Gleixner tglx@linutronix.de CC: Paul Turner pjt@google.com CC: Andrew Hunter ahh@google.com CC: Peter Zijlstra peterz@infradead.org CC: Andy Lutomirski luto@amacapital.net CC: Andi Kleen andi@firstfloor.org CC: Dave Watson davejwatson@fb.com CC: Chris Lameter cl@linux.com CC: Ingo Molnar mingo@redhat.com CC: "H. Peter Anvin" hpa@zytor.com CC: Ben Maurer bmaurer@fb.com CC: Steven Rostedt rostedt@goodmis.org CC: "Paul E. McKenney" paulmck@linux.vnet.ibm.com CC: Josh Triplett josh@joshtriplett.org CC: Linus Torvalds torvalds@linux-foundation.org CC: Andrew Morton akpm@linux-foundation.org CC: Boqun Feng boqun.feng@gmail.com CC: linux-kselftest@vger.kernel.org CC: linux-api@vger.kernel.org --- tools/testing/selftests/lib.mk | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk index 7de482a0519d..3d4bdeb072b2 100644 --- a/tools/testing/selftests/lib.mk +++ b/tools/testing/selftests/lib.mk @@ -105,6 +105,9 @@ COMPILE.S = $(CC) $(ASFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c LINK.S = $(CC) $(ASFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH) endif
+# Selftest makefiles can override those targets by setting +# OVERRIDE_TARGETS = 1. +ifeq ($(OVERRIDE_TARGETS),) $(OUTPUT)/%:%.c $(LINK.c) $^ $(LDLIBS) -o $@
@@ -113,5 +116,6 @@ $(OUTPUT)/%.o:%.S
$(OUTPUT)/%:%.S $(LINK.S) $^ $(LDLIBS) -o $@ +endif
.PHONY: run_tests all clean install emit_tests