Skip to content

Commit

Permalink
selftests: Fix the .S and .S -> .o rules
Browse files Browse the repository at this point in the history
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: a8ba798 ("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>
  • Loading branch information
Michael Ellerman authored and Shuah Khan committed Feb 14, 2017
1 parent 2047f1d commit 634ce97
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/testing/selftests/lib.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 634ce97

Please sign in to comment.