selftests: Fix the .S and .S -> .o rules
authorMichael Ellerman <mpe@ellerman.id.au>
Thu, 9 Feb 2017 08:56:28 +0000 (19:56 +1100)
committerShuah Khan <shuahkh@osg.samsung.com>
Tue, 14 Feb 2017 15:02:01 +0000 (08:02 -0700)
Both these rules incorrectly use $< (first prerequisite) rather than
$^ (all prerequisites), meaning they don't work if we're using more than
one .S file as input. Switch them to using $^.

They also don't include $(CPPFLAGS) and other variables used in the
default rules, which breaks targets that require those. Fix that by
using the builtin $(COMPILE.S) and $(LINK.S) rules.

Fixes: a8ba798bc8ec ("selftests: enable O and KBUILD_OUTPUT")
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Tested by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
tools/testing/selftests/lib.mk

index 98841c54763a621bbc204701515d94ed7197d1e0..ce96d80ad64f4da000ecec590365582d399fadf3 100644 (file)
@@ -54,9 +54,9 @@ $(OUTPUT)/%:%.c
        $(LINK.c) $^ $(LDLIBS) -o $@
 
 $(OUTPUT)/%.o:%.S
-       $(CC) $(ASFLAGS) -c $< -o $@
+       $(COMPILE.S) $^ -o $@
 
 $(OUTPUT)/%:%.S
-       $(CC) $(ASFLAGS) $< -o $@
+       $(LINK.S) $^ $(LDLIBS) -o $@
 
 .PHONY: run_tests all clean install emit_tests