diff --git a/tools/testing/selftests/exec/Makefile b/tools/testing/selftests/exec/Makefile index 9eb1c3e4d33949c6876c184ab842fa1af01fc535..48d1f863d584f619c7aa525b313b22c4f3136830 100644 --- a/tools/testing/selftests/exec/Makefile +++ b/tools/testing/selftests/exec/Makefile @@ -1,5 +1,14 @@ CFLAGS = -Wall +TEST_GEN_PROGS := execveat +TEST_GEN_FILES := execveat.symlink execveat.denatured script subdir +# Makefile is a run-time dependency, since it's accessed by the execveat test +TEST_FILES := Makefile + +EXTRA_CLEAN := subdir.moved execveat.moved xxxxx* + +include ../lib.mk + subdir: mkdir -p $@ script: @@ -11,13 +20,3 @@ execveat.symlink: execveat execveat.denatured: execveat cp $< $@ chmod -x $@ - -TEST_GEN_PROGS := execveat -TEST_GEN_FILES := execveat.symlink execveat.denatured script subdir -# Makefile is a run-time dependency, since it's accessed by the execveat test -TEST_FILES := Makefile - -include ../lib.mk - -clean: - rm -rf $(TEST_GEN_PROGS) $(TEST_GEN_FILES) subdir.moved execveat.moved xxxxx* diff --git a/tools/testing/selftests/ftrace/Makefile b/tools/testing/selftests/ftrace/Makefile index a71530097352ce150d30e512bd415b80bff83cb0..6c64b421a4fdb81463cf91f9c661f74053a7d579 100644 --- a/tools/testing/selftests/ftrace/Makefile +++ b/tools/testing/selftests/ftrace/Makefile @@ -2,8 +2,6 @@ all: TEST_PROGS := ftracetest TEST_FILES := test.d +EXTRA_CLEAN := logs/* include ../lib.mk - -clean: - rm -rf logs/* diff --git a/tools/testing/selftests/kcmp/Makefile b/tools/testing/selftests/kcmp/Makefile index 9e8b673d41b126637e2164a48bbf3a3a19f54f41..74a8adda58fbc80d81819cf6e7146f0206488334 100644 --- a/tools/testing/selftests/kcmp/Makefile +++ b/tools/testing/selftests/kcmp/Makefile @@ -2,7 +2,7 @@ CFLAGS += -I../../../../usr/include/ TEST_GEN_PROGS := kcmp_test +EXTRA_CLEAN := kcmp-test-file + include ../lib.mk -clean: - $(RM) $(TEST_GEN_PROGS) kcmp-test-file diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk index 68d7c01b9f061db32c047740af05002c72b6046f..0f7a371beff7bf197c6ab72dc971dff5b99bc676 100644 --- a/tools/testing/selftests/lib.mk +++ b/tools/testing/selftests/lib.mk @@ -43,7 +43,7 @@ emit_tests: all: $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES) clean: - $(RM) -r $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES) + $(RM) -r $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES) $(EXTRA_CLEAN) %: %.c $(CC) $(CFLAGS) $(LDFLAGS) $(LDLIBS) -o $@ $^ diff --git a/tools/testing/selftests/powerpc/switch_endian/Makefile b/tools/testing/selftests/powerpc/switch_endian/Makefile index bd0122306da669427c670f5c89390552ceb83225..dbd05ac8dbf7e9323101aab7443f55fb65d01de7 100644 --- a/tools/testing/selftests/powerpc/switch_endian/Makefile +++ b/tools/testing/selftests/powerpc/switch_endian/Makefile @@ -2,6 +2,8 @@ TEST_GEN_PROGS := switch_endian_test ASFLAGS += -O2 -Wall -g -nostdlib -m64 +EXTRA_CLEAN = *.o check-reversed.S + include ../../lib.mk switch_endian_test: check-reversed.S @@ -11,6 +13,3 @@ check-reversed.o: check.o check-reversed.S: check-reversed.o hexdump -v -e '/1 ".byte 0x%02X\n"' $< > $@ - -clean: - $(RM) $(TEST_GEN_PROGS) *.o check-reversed.S diff --git a/tools/testing/selftests/pstore/Makefile b/tools/testing/selftests/pstore/Makefile index bd7abe24ea081442850c88d1b559fe9926a2580c..c5f2440ba1f707fe3c447cedcd00756c1c735496 100644 --- a/tools/testing/selftests/pstore/Makefile +++ b/tools/testing/selftests/pstore/Makefile @@ -5,11 +5,9 @@ all: TEST_PROGS := pstore_tests pstore_post_reboot_tests TEST_FILES := common_tests pstore_crash_test +EXTRA_CLEAN := logs/* *uuid include ../lib.mk run_crash: @sh pstore_crash_test || { echo "pstore_crash_test: [FAIL]"; exit 1; } - -clean: - rm -rf logs/* *uuid diff --git a/tools/testing/selftests/zram/Makefile b/tools/testing/selftests/zram/Makefile index 29d80346e3eb5a14108e3e3f514182806ab584e1..c3a87e5f9d36482c4a606afe9c6e82bfff8fe90c 100644 --- a/tools/testing/selftests/zram/Makefile +++ b/tools/testing/selftests/zram/Makefile @@ -2,8 +2,7 @@ all: TEST_PROGS := zram.sh TEST_FILES := zram01.sh zram02.sh zram_lib.sh +EXTRA_CLEAN := err.log include ../lib.mk -clean: - $(RM) err.log