# \[PATCH\] kselftest: replace $(RM) with rm -f command

- Subsystems: KERNEL SELFTEST FRAMEWORK, MEMORY MANAGEMENT - SHARED MEMORY (SHMEM/TMPFS/MEMFD), NETWORKING \[GENERAL\], SECURE COMPUTING, THE REST, ZRAM COMPRESSED RAM BLOCK DEVICE DRVIER
- Maintainers: Shuah Khan, Shuah Khan, Hugh Dickins, David Hildenbrand, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Kees Cook, Linus Torvalds, Minchan Kim, Sergey Senozhatsky
- List: linux-api
- 10 messages, 7 authors
- Page: https://ratatoskr.run/linux-api/2015/09/4584576/t

## \[PATCH\] kselftest: replace $(RM) with rm -f command

- From: Wang Long \<hidden\>
- Date: 2015-09-28 02:11:50 
- Message: https://ratatoskr.run/linux-api/2015/09/4584576.md

```text
Some test's Makefile using "$(RM)" while the other's
using "rm -f". It is better to use one of them in all
tests.

"rm -f" is better, because it is less magic, and everyone
konws what is does.

Signed-off-by: Wang Long <redacted>
---
 tools/testing/selftests/capabilities/Makefile | 2 +-
 tools/testing/selftests/kcmp/Makefile         | 2 +-
 tools/testing/selftests/membarrier/Makefile   | 2 +-
 tools/testing/selftests/memfd/Makefile        | 2 +-
 tools/testing/selftests/net/Makefile          | 2 +-
 tools/testing/selftests/seccomp/Makefile      | 2 +-
 tools/testing/selftests/size/Makefile         | 2 +-
 tools/testing/selftests/vm/Makefile           | 2 +-
 tools/testing/selftests/x86/Makefile          | 2 +-
 tools/testing/selftests/zram/Makefile         | 2 +-
 10 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/tools/testing/selftests/capabilities/Makefile b/tools/testing/selftests/capabilities/Makefile
index 8c8f0c1..dcc1972 100644
--- a/tools/testing/selftests/capabilities/Makefile
+++ b/tools/testing/selftests/capabilities/Makefile
@@ -12,7 +12,7 @@ CFLAGS := -O2 -g -std=gnu99 -Wall -lcap-ng
 all: $(TARGETS)
 
 clean:
-	$(RM) $(TARGETS)
+	rm -f $(TARGETS)
 
 $(TARGETS): %: %.c
 	$(CC) -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $^ -lrt -ldl
diff --git a/tools/testing/selftests/kcmp/Makefile b/tools/testing/selftests/kcmp/Makefile
index 2ae7450..2deaee0 100644
--- a/tools/testing/selftests/kcmp/Makefile
+++ b/tools/testing/selftests/kcmp/Makefile
@@ -7,4 +7,4 @@ TEST_PROGS := kcmp_test
 include ../lib.mk
 
 clean:
-	$(RM) kcmp_test kcmp-test-file
+	rn -f kcmp_test kcmp-test-file
diff --git a/tools/testing/selftests/membarrier/Makefile b/tools/testing/selftests/membarrier/Makefile
index a1a9708..f23fc58 100644
--- a/tools/testing/selftests/membarrier/Makefile
+++ b/tools/testing/selftests/membarrier/Makefile
@@ -7,4 +7,4 @@ all: $(TEST_PROGS)
 include ../lib.mk
 
 clean:
-	$(RM) $(TEST_PROGS)
+	rm -f $(TEST_PROGS)
diff --git a/tools/testing/selftests/memfd/Makefile b/tools/testing/selftests/memfd/Makefile
index 3e7eb79..068fa93 100644
--- a/tools/testing/selftests/memfd/Makefile
+++ b/tools/testing/selftests/memfd/Makefile
@@ -19,4 +19,4 @@ run_fuse: build_fuse
 	@./run_fuse_test.sh || echo "fuse_test: [FAIL]"
 
 clean:
-	$(RM) memfd_test fuse_test
+	rm -f memfd_test fuse_test
diff --git a/tools/testing/selftests/net/Makefile b/tools/testing/selftests/net/Makefile
index fac4782..ec7eaa4 100644
--- a/tools/testing/selftests/net/Makefile
+++ b/tools/testing/selftests/net/Makefile
@@ -16,4 +16,4 @@ TEST_FILES := $(NET_PROGS)
 include ../lib.mk
 
 clean:
-	$(RM) $(NET_PROGS)
+	rm -f $(NET_PROGS)
diff --git a/tools/testing/selftests/seccomp/Makefile b/tools/testing/selftests/seccomp/Makefile
index 8401e87..c16072a 100644
--- a/tools/testing/selftests/seccomp/Makefile
+++ b/tools/testing/selftests/seccomp/Makefile
@@ -7,4 +7,4 @@ all: $(TEST_PROGS)
 include ../lib.mk
 
 clean:
-	$(RM) $(TEST_PROGS)
+	rm -f $(TEST_PROGS)
diff --git a/tools/testing/selftests/size/Makefile b/tools/testing/selftests/size/Makefile
index bbd0b53..cefe914 100644
--- a/tools/testing/selftests/size/Makefile
+++ b/tools/testing/selftests/size/Makefile
@@ -8,4 +8,4 @@ TEST_PROGS := get_size
 include ../lib.mk
 
 clean:
-	$(RM) get_size
+	rm -f get_size
diff --git a/tools/testing/selftests/vm/Makefile b/tools/testing/selftests/vm/Makefile
index 3c53cac..26663c7 100644
--- a/tools/testing/selftests/vm/Makefile
+++ b/tools/testing/selftests/vm/Makefile
@@ -24,4 +24,4 @@ TEST_FILES := $(BINARIES)
 include ../lib.mk
 
 clean:
-	$(RM) $(BINARIES)
+	rm -f $(BINARIES)
diff --git a/tools/testing/selftests/x86/Makefile b/tools/testing/selftests/x86/Makefile
index 29089b2..48b2406 100644
--- a/tools/testing/selftests/x86/Makefile
+++ b/tools/testing/selftests/x86/Makefile
@@ -32,7 +32,7 @@ all_32: $(BINARIES_32)
 all_64: $(BINARIES_64)
 
 clean:
-	$(RM) $(BINARIES_32) $(BINARIES_64)
+	rm -f $(BINARIES_32) $(BINARIES_64)
 
 $(TARGETS_C_32BIT_ALL:%=%_32): %_32: %.c
 	$(CC) -m32 -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $^ -lrt -ldl
diff --git a/tools/testing/selftests/zram/Makefile b/tools/testing/selftests/zram/Makefile
index 29d8034..e1591c8 100644
--- a/tools/testing/selftests/zram/Makefile
+++ b/tools/testing/selftests/zram/Makefile
@@ -6,4 +6,4 @@ TEST_FILES := zram01.sh zram02.sh zram_lib.sh
 include ../lib.mk
 
 clean:
-	$(RM) err.log
+	rm -f err.log
-- 
1.8.3.4
```

## Re: \[PATCH\] kselftest: replace $(RM) with rm -f command

- From: Mathieu Desnoyers \<mathieu.desnoyers@efficios.com\>
- Date: 2015-09-28 03:17:12 
- Message: https://ratatoskr.run/linux-api/2015/09/4584585.md

```text
----- On Sep 27, 2015, at 10:10 PM, Wang Long long.wanglong-hv44wF8Li93QT0dZR+AlfA@public.gmane.org wrote:

> Some test's Makefile using "$(RM)" while the other's
> using "rm -f". It is better to use one of them in all
> tests.

I agree that this disparity appears to be unwanted. We
should settle on one or the other.

> 
> "rm -f" is better, because it is less magic, and everyone
> konws what is does.

"$(RM)" is clearly defined as a Makefile implicit variable
which defaults to "rm -f".
Ref. https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html

Leaving it as a variable is more flexible because then the
default behavior can be overridden if need be, which is
not the case of a hardcoded "rm -f".

Following your line of argumentation, we should then
invoke "gcc" directly in every Makefile because it is
less magic than "$(CC)". This makes no sense.

Thanks,

Mathieu

> 
> Signed-off-by: Wang Long <redacted>
> ---
> tools/testing/selftests/capabilities/Makefile | 2 +-
> tools/testing/selftests/kcmp/Makefile         | 2 +-
> tools/testing/selftests/membarrier/Makefile   | 2 +-
> tools/testing/selftests/memfd/Makefile        | 2 +-
> tools/testing/selftests/net/Makefile          | 2 +-
> tools/testing/selftests/seccomp/Makefile      | 2 +-
> tools/testing/selftests/size/Makefile         | 2 +-
> tools/testing/selftests/vm/Makefile           | 2 +-
> tools/testing/selftests/x86/Makefile          | 2 +-
> tools/testing/selftests/zram/Makefile         | 2 +-
> 10 files changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/tools/testing/selftests/capabilities/Makefile
> b/tools/testing/selftests/capabilities/Makefile
> index 8c8f0c1..dcc1972 100644
> --- a/tools/testing/selftests/capabilities/Makefile
> +++ b/tools/testing/selftests/capabilities/Makefile
> @@ -12,7 +12,7 @@ CFLAGS := -O2 -g -std=gnu99 -Wall -lcap-ng
> all: $(TARGETS)
> 
> clean:
> -	$(RM) $(TARGETS)
> +	rm -f $(TARGETS)
> 
> $(TARGETS): %: %.c
> 	$(CC) -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $^ -lrt -ldl
> diff --git a/tools/testing/selftests/kcmp/Makefile
> b/tools/testing/selftests/kcmp/Makefile
> index 2ae7450..2deaee0 100644
> --- a/tools/testing/selftests/kcmp/Makefile
> +++ b/tools/testing/selftests/kcmp/Makefile
> @@ -7,4 +7,4 @@ TEST_PROGS := kcmp_test
> include ../lib.mk
> 
> clean:
> -	$(RM) kcmp_test kcmp-test-file
> +	rn -f kcmp_test kcmp-test-file
> diff --git a/tools/testing/selftests/membarrier/Makefile
> b/tools/testing/selftests/membarrier/Makefile
> index a1a9708..f23fc58 100644
> --- a/tools/testing/selftests/membarrier/Makefile
> +++ b/tools/testing/selftests/membarrier/Makefile
> @@ -7,4 +7,4 @@ all: $(TEST_PROGS)
> include ../lib.mk
> 
> clean:
> -	$(RM) $(TEST_PROGS)
> +	rm -f $(TEST_PROGS)
> diff --git a/tools/testing/selftests/memfd/Makefile
> b/tools/testing/selftests/memfd/Makefile
> index 3e7eb79..068fa93 100644
> --- a/tools/testing/selftests/memfd/Makefile
> +++ b/tools/testing/selftests/memfd/Makefile
> @@ -19,4 +19,4 @@ run_fuse: build_fuse
> 	@./run_fuse_test.sh || echo "fuse_test: [FAIL]"
> 
> clean:
> -	$(RM) memfd_test fuse_test
> +	rm -f memfd_test fuse_test
> diff --git a/tools/testing/selftests/net/Makefile
> b/tools/testing/selftests/net/Makefile
> index fac4782..ec7eaa4 100644
> --- a/tools/testing/selftests/net/Makefile
> +++ b/tools/testing/selftests/net/Makefile
> @@ -16,4 +16,4 @@ TEST_FILES := $(NET_PROGS)
> include ../lib.mk
> 
> clean:
> -	$(RM) $(NET_PROGS)
> +	rm -f $(NET_PROGS)
> diff --git a/tools/testing/selftests/seccomp/Makefile
> b/tools/testing/selftests/seccomp/Makefile
> index 8401e87..c16072a 100644
> --- a/tools/testing/selftests/seccomp/Makefile
> +++ b/tools/testing/selftests/seccomp/Makefile
> @@ -7,4 +7,4 @@ all: $(TEST_PROGS)
> include ../lib.mk
> 
> clean:
> -	$(RM) $(TEST_PROGS)
> +	rm -f $(TEST_PROGS)
> diff --git a/tools/testing/selftests/size/Makefile
> b/tools/testing/selftests/size/Makefile
> index bbd0b53..cefe914 100644
> --- a/tools/testing/selftests/size/Makefile
> +++ b/tools/testing/selftests/size/Makefile
> @@ -8,4 +8,4 @@ TEST_PROGS := get_size
> include ../lib.mk
> 
> clean:
> -	$(RM) get_size
> +	rm -f get_size
> diff --git a/tools/testing/selftests/vm/Makefile
> b/tools/testing/selftests/vm/Makefile
> index 3c53cac..26663c7 100644
> --- a/tools/testing/selftests/vm/Makefile
> +++ b/tools/testing/selftests/vm/Makefile
> @@ -24,4 +24,4 @@ TEST_FILES := $(BINARIES)
> include ../lib.mk
> 
> clean:
> -	$(RM) $(BINARIES)
> +	rm -f $(BINARIES)
> diff --git a/tools/testing/selftests/x86/Makefile
> b/tools/testing/selftests/x86/Makefile
> index 29089b2..48b2406 100644
> --- a/tools/testing/selftests/x86/Makefile
> +++ b/tools/testing/selftests/x86/Makefile
> @@ -32,7 +32,7 @@ all_32: $(BINARIES_32)
> all_64: $(BINARIES_64)
> 
> clean:
> -	$(RM) $(BINARIES_32) $(BINARIES_64)
> +	rm -f $(BINARIES_32) $(BINARIES_64)
> 
> $(TARGETS_C_32BIT_ALL:%=%_32): %_32: %.c
> 	$(CC) -m32 -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $^ -lrt -ldl
> diff --git a/tools/testing/selftests/zram/Makefile
> b/tools/testing/selftests/zram/Makefile
> index 29d8034..e1591c8 100644
> --- a/tools/testing/selftests/zram/Makefile
> +++ b/tools/testing/selftests/zram/Makefile
> @@ -6,4 +6,4 @@ TEST_FILES := zram01.sh zram02.sh zram_lib.sh
> include ../lib.mk
> 
> clean:
> -	$(RM) err.log
> +	rm -f err.log
> --
> 1.8.3.4

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
```

## Re: \[PATCH\] kselftest: replace $(RM) with rm -f command

- From: Yuan Sun \<hidden\>
- Date: 2015-09-28 07:33:09 
- Message: https://ratatoskr.run/linux-api/2015/09/4584681.md

```text
See the in-line comment.
On 2015/9/28 10:10, Wang Long wrote:
> Some test's Makefile using "$(RM)" while the other's
> using "rm -f". It is better to use one of them in all
> tests.
>
> "rm -f" is better, because it is less magic, and everyone
> konws what is does.
>
> Signed-off-by: Wang Long <redacted>
> ---
>   tools/testing/selftests/capabilities/Makefile | 2 +-
>   tools/testing/selftests/kcmp/Makefile         | 2 +-
>   tools/testing/selftests/membarrier/Makefile   | 2 +-
>   tools/testing/selftests/memfd/Makefile        | 2 +-
>   tools/testing/selftests/net/Makefile          | 2 +-
>   tools/testing/selftests/seccomp/Makefile      | 2 +-
>   tools/testing/selftests/size/Makefile         | 2 +-
>   tools/testing/selftests/vm/Makefile           | 2 +-
>   tools/testing/selftests/x86/Makefile          | 2 +-
>   tools/testing/selftests/zram/Makefile         | 2 +-
>   10 files changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/tools/testing/selftests/capabilities/Makefile b/tools/testing/selftests/capabilities/Makefile
> index 8c8f0c1..dcc1972 100644
> --- a/tools/testing/selftests/capabilities/Makefile
> +++ b/tools/testing/selftests/capabilities/Makefile
> @@ -12,7 +12,7 @@ CFLAGS := -O2 -g -std=gnu99 -Wall -lcap-ng
>   all: $(TARGETS)
>   
>   clean:
> -	$(RM) $(TARGETS)
> +	rm -f $(TARGETS)
>   
>   $(TARGETS): %: %.c
>   	$(CC) -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $^ -lrt -ldl
> diff --git a/tools/testing/selftests/kcmp/Makefile b/tools/testing/selftests/kcmp/Makefile
> index 2ae7450..2deaee0 100644
> --- a/tools/testing/selftests/kcmp/Makefile
> +++ b/tools/testing/selftests/kcmp/Makefile
> @@ -7,4 +7,4 @@ TEST_PROGS := kcmp_test
>   include ../lib.mk
>   
>   clean:
> -	$(RM) kcmp_test kcmp-test-file
> +	rn -f kcmp_test kcmp-test-file
It should be rm, not rn.
> diff --git a/tools/testing/selftests/membarrier/Makefile b/tools/testing/selftests/membarrier/Makefile
> index a1a9708..f23fc58 100644
> --- a/tools/testing/selftests/membarrier/Makefile
> +++ b/tools/testing/selftests/membarrier/Makefile
> @@ -7,4 +7,4 @@ all: $(TEST_PROGS)
>   include ../lib.mk
>   
>   clean:
> -	$(RM) $(TEST_PROGS)
> +	rm -f $(TEST_PROGS)
> diff --git a/tools/testing/selftests/memfd/Makefile b/tools/testing/selftests/memfd/Makefile
> index 3e7eb79..068fa93 100644
> --- a/tools/testing/selftests/memfd/Makefile
> +++ b/tools/testing/selftests/memfd/Makefile
> @@ -19,4 +19,4 @@ run_fuse: build_fuse
>   	@./run_fuse_test.sh || echo "fuse_test: [FAIL]"
>   
>   clean:
> -	$(RM) memfd_test fuse_test
> +	rm -f memfd_test fuse_test
> diff --git a/tools/testing/selftests/net/Makefile b/tools/testing/selftests/net/Makefile
> index fac4782..ec7eaa4 100644
> --- a/tools/testing/selftests/net/Makefile
> +++ b/tools/testing/selftests/net/Makefile
> @@ -16,4 +16,4 @@ TEST_FILES := $(NET_PROGS)
>   include ../lib.mk
>   
>   clean:
> -	$(RM) $(NET_PROGS)
> +	rm -f $(NET_PROGS)
> diff --git a/tools/testing/selftests/seccomp/Makefile b/tools/testing/selftests/seccomp/Makefile
> index 8401e87..c16072a 100644
> --- a/tools/testing/selftests/seccomp/Makefile
> +++ b/tools/testing/selftests/seccomp/Makefile
> @@ -7,4 +7,4 @@ all: $(TEST_PROGS)
>   include ../lib.mk
>   
>   clean:
> -	$(RM) $(TEST_PROGS)
> +	rm -f $(TEST_PROGS)
> diff --git a/tools/testing/selftests/size/Makefile b/tools/testing/selftests/size/Makefile
> index bbd0b53..cefe914 100644
> --- a/tools/testing/selftests/size/Makefile
> +++ b/tools/testing/selftests/size/Makefile
> @@ -8,4 +8,4 @@ TEST_PROGS := get_size
>   include ../lib.mk
>   
>   clean:
> -	$(RM) get_size
> +	rm -f get_size
> diff --git a/tools/testing/selftests/vm/Makefile b/tools/testing/selftests/vm/Makefile
> index 3c53cac..26663c7 100644
> --- a/tools/testing/selftests/vm/Makefile
> +++ b/tools/testing/selftests/vm/Makefile
> @@ -24,4 +24,4 @@ TEST_FILES := $(BINARIES)
>   include ../lib.mk
>   
>   clean:
> -	$(RM) $(BINARIES)
> +	rm -f $(BINARIES)
> diff --git a/tools/testing/selftests/x86/Makefile b/tools/testing/selftests/x86/Makefile
> index 29089b2..48b2406 100644
> --- a/tools/testing/selftests/x86/Makefile
> +++ b/tools/testing/selftests/x86/Makefile
> @@ -32,7 +32,7 @@ all_32: $(BINARIES_32)
>   all_64: $(BINARIES_64)
>   
>   clean:
> -	$(RM) $(BINARIES_32) $(BINARIES_64)
> +	rm -f $(BINARIES_32) $(BINARIES_64)
>   
>   $(TARGETS_C_32BIT_ALL:%=%_32): %_32: %.c
>   	$(CC) -m32 -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $^ -lrt -ldl
> diff --git a/tools/testing/selftests/zram/Makefile b/tools/testing/selftests/zram/Makefile
> index 29d8034..e1591c8 100644
> --- a/tools/testing/selftests/zram/Makefile
> +++ b/tools/testing/selftests/zram/Makefile
> @@ -6,4 +6,4 @@ TEST_FILES := zram01.sh zram02.sh zram_lib.sh
>   include ../lib.mk
>   
>   clean:
> -	$(RM) err.log
> +	rm -f err.log
```

## Re: \[PATCH\] kselftest: replace $(RM) with rm -f command

- From: Michael Ellerman \<mpe@ellerman.id.au\>
- Date: 2015-09-29 09:57:58 
- Message: https://ratatoskr.run/linux-api/2015/09/4585697.md

```text
On Mon, 2015-09-28 at 03:16 +0000, Mathieu Desnoyers wrote:
> ----- On Sep 27, 2015, at 10:10 PM, Wang Long long.wanglong-hv44wF8Li93QT0dZR+AlfA@public.gmane.org wrote:
> 
> > Some test's Makefile using "$(RM)" while the other's
> > using "rm -f". It is better to use one of them in all
> > tests.
> 
> I agree that this disparity appears to be unwanted. We
> should settle on one or the other.
> 
> > "rm -f" is better, because it is less magic, and everyone
> > konws what is does.
> 
> "$(RM)" is clearly defined as a Makefile implicit variable
> which defaults to "rm -f".
> Ref. https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html

Sure, but you had to look it up didn't you :) - I did.

> Leaving it as a variable is more flexible because then the
> default behavior can be overridden if need be, which is
> not the case of a hardcoded "rm -f".

But I don't think anyone actually wants to do that. Do they?

Anyway I don't really care either way, so I'm happy for you to do a patch that
uses $(RM). Or maybe Wang Long will be happy to respin his patch to use $(RM).

cheers
```

## \[PATCH\] kselftest: replace rm -f command with $(RM)

- From: Wang Long \<hidden\>
- Date: 2015-09-29 11:22:55 
- Message: https://ratatoskr.run/linux-api/2015/09/4585742.md

```text
Some test's Makefile using "$(RM)" while the other's
using "rm -f". It is better to use one of them in all
tests.

"$(RM)" is clearly defined as a Makefile implicit variable
which defaults to "rm -f".
Ref. https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html

Signed-off-by: Wang Long <redacted>
---
 tools/testing/selftests/breakpoints/Makefile           | 2 +-
 tools/testing/selftests/efivarfs/Makefile              | 2 +-
 tools/testing/selftests/futex/functional/Makefile      | 2 +-
 tools/testing/selftests/ipc/Makefile                   | 2 +-
 tools/testing/selftests/mount/Makefile                 | 2 +-
 tools/testing/selftests/mqueue/Makefile                | 2 +-
 tools/testing/selftests/powerpc/Makefile               | 2 +-
 tools/testing/selftests/powerpc/copyloops/Makefile     | 2 +-
 tools/testing/selftests/powerpc/dscr/Makefile          | 2 +-
 tools/testing/selftests/powerpc/mm/Makefile            | 2 +-
 tools/testing/selftests/powerpc/pmu/Makefile           | 2 +-
 tools/testing/selftests/powerpc/pmu/ebb/Makefile       | 2 +-
 tools/testing/selftests/powerpc/primitives/Makefile    | 2 +-
 tools/testing/selftests/powerpc/stringloops/Makefile   | 2 +-
 tools/testing/selftests/powerpc/switch_endian/Makefile | 2 +-
 tools/testing/selftests/powerpc/tm/Makefile            | 2 +-
 tools/testing/selftests/powerpc/vphn/Makefile          | 2 +-
 tools/testing/selftests/ptrace/Makefile                | 2 +-
 tools/testing/selftests/timers/Makefile                | 2 +-
 19 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/tools/testing/selftests/breakpoints/Makefile b/tools/testing/selftests/breakpoints/Makefile
index d27108b..731bd31 100644
--- a/tools/testing/selftests/breakpoints/Makefile
+++ b/tools/testing/selftests/breakpoints/Makefile
@@ -11,4 +11,4 @@ all:
 include ../lib.mk
 
 clean:
-	rm -fr breakpoint_test
+	$(RM) breakpoint_test
diff --git a/tools/testing/selftests/efivarfs/Makefile b/tools/testing/selftests/efivarfs/Makefile
index 736c3dd..4a1c629 100644
--- a/tools/testing/selftests/efivarfs/Makefile
+++ b/tools/testing/selftests/efivarfs/Makefile
@@ -10,4 +10,4 @@ TEST_FILES := $(test_objs)
 include ../lib.mk
 
 clean:
-	rm -f $(test_objs)
+	$(RM) $(test_objs)
diff --git a/tools/testing/selftests/futex/functional/Makefile b/tools/testing/selftests/futex/functional/Makefile
index 9d6b75e..391d328 100644
--- a/tools/testing/selftests/futex/functional/Makefile
+++ b/tools/testing/selftests/futex/functional/Makefile
@@ -22,4 +22,4 @@ $(TARGETS): $(HEADERS)
 include ../../lib.mk
 
 clean:
-	rm -f $(TARGETS)
+	$(RM) $(TARGETS)
diff --git a/tools/testing/selftests/ipc/Makefile b/tools/testing/selftests/ipc/Makefile
index 25d2e70..071a706 100644
--- a/tools/testing/selftests/ipc/Makefile
+++ b/tools/testing/selftests/ipc/Makefile
@@ -19,4 +19,4 @@ TEST_PROGS := msgque_test
 include ../lib.mk
 
 clean:
-	rm -fr ./msgque_test
+	$(RM) ./msgque_test
diff --git a/tools/testing/selftests/mount/Makefile b/tools/testing/selftests/mount/Makefile
index 5e35c9c..9629382 100644
--- a/tools/testing/selftests/mount/Makefile
+++ b/tools/testing/selftests/mount/Makefile
@@ -18,4 +18,4 @@ override RUN_TESTS := if [ -f /proc/self/uid_map ] ; \
 override EMIT_TESTS := echo "$(RUN_TESTS)"
 
 clean:
-	rm -f unprivileged-remount-test
+	$(RM) unprivileged-remount-test
diff --git a/tools/testing/selftests/mqueue/Makefile b/tools/testing/selftests/mqueue/Makefile
index eebac29..d61b987 100644
--- a/tools/testing/selftests/mqueue/Makefile
+++ b/tools/testing/selftests/mqueue/Makefile
@@ -17,4 +17,4 @@ override define EMIT_TESTS
 endef
 
 clean:
-	rm -f mq_open_tests mq_perf_tests
+	$(RM) mq_open_tests mq_perf_tests
diff --git a/tools/testing/selftests/powerpc/Makefile b/tools/testing/selftests/powerpc/Makefile
index 03ca2e6..91aa06d 100644
--- a/tools/testing/selftests/powerpc/Makefile
+++ b/tools/testing/selftests/powerpc/Makefile
@@ -45,7 +45,7 @@ clean:
 	@for TARGET in $(SUB_DIRS); do \
 		$(MAKE) -C $$TARGET clean; \
 	done;
-	rm -f tags
+	$(RM) tags
 
 tags:
 	find . -name '*.c' -o -name '*.h' | xargs ctags
diff --git a/tools/testing/selftests/powerpc/copyloops/Makefile b/tools/testing/selftests/powerpc/copyloops/Makefile
index 384843e..28d6d6c 100644
--- a/tools/testing/selftests/powerpc/copyloops/Makefile
+++ b/tools/testing/selftests/powerpc/copyloops/Makefile
@@ -22,4 +22,4 @@ $(TEST_PROGS): $(EXTRA_SOURCES)
 include ../../lib.mk
 
 clean:
-	rm -f $(TEST_PROGS) *.o
+	$(RM) $(TEST_PROGS) *.o
diff --git a/tools/testing/selftests/powerpc/dscr/Makefile b/tools/testing/selftests/powerpc/dscr/Makefile
index 49327ee..d32a66e 100644
--- a/tools/testing/selftests/powerpc/dscr/Makefile
+++ b/tools/testing/selftests/powerpc/dscr/Makefile
@@ -11,4 +11,4 @@ $(TEST_PROGS): ../harness.c
 include ../../lib.mk
 
 clean:
-	rm -f $(TEST_PROGS) *.o
+	$(RM) $(TEST_PROGS) *.o
diff --git a/tools/testing/selftests/powerpc/mm/Makefile b/tools/testing/selftests/powerpc/mm/Makefile
index ee179e2..7f63469 100644
--- a/tools/testing/selftests/powerpc/mm/Makefile
+++ b/tools/testing/selftests/powerpc/mm/Makefile
@@ -14,4 +14,4 @@ tempfile:
 	dd if=/dev/zero of=tempfile bs=64k count=1
 
 clean:
-	rm -f $(TEST_PROGS) tempfile
+	$(RM) $(TEST_PROGS) tempfile
diff --git a/tools/testing/selftests/powerpc/pmu/Makefile b/tools/testing/selftests/powerpc/pmu/Makefile
index a9099d9..170f3a6 100644
--- a/tools/testing/selftests/powerpc/pmu/Makefile
+++ b/tools/testing/selftests/powerpc/pmu/Makefile
@@ -33,7 +33,7 @@ override define INSTALL_RULE
 endef
 
 clean:
-	rm -f $(TEST_PROGS) loop.o
+	$(RM) $(TEST_PROGS) loop.o
 	$(MAKE) -C ebb clean
 
 ebb:
diff --git a/tools/testing/selftests/powerpc/pmu/ebb/Makefile b/tools/testing/selftests/powerpc/pmu/ebb/Makefile
index 5cdc9db..977875f 100644
--- a/tools/testing/selftests/powerpc/pmu/ebb/Makefile
+++ b/tools/testing/selftests/powerpc/pmu/ebb/Makefile
@@ -27,4 +27,4 @@ lost_exception_test: ../lib.c
 include ../../../lib.mk
 
 clean:
-	rm -f $(TEST_PROGS)
+	$(RM) $(TEST_PROGS)
diff --git a/tools/testing/selftests/powerpc/primitives/Makefile b/tools/testing/selftests/powerpc/primitives/Makefile
index b68c622..2261bd1 100644
--- a/tools/testing/selftests/powerpc/primitives/Makefile
+++ b/tools/testing/selftests/powerpc/primitives/Makefile
@@ -9,4 +9,4 @@ $(TEST_PROGS): ../harness.c
 include ../../lib.mk
 
 clean:
-	rm -f $(TEST_PROGS) *.o
+	$(RM) $(TEST_PROGS) *.o
diff --git a/tools/testing/selftests/powerpc/stringloops/Makefile b/tools/testing/selftests/powerpc/stringloops/Makefile
index 2a728f4..ea89afd 100644
--- a/tools/testing/selftests/powerpc/stringloops/Makefile
+++ b/tools/testing/selftests/powerpc/stringloops/Makefile
@@ -12,4 +12,4 @@ $(TEST_PROGS): $(EXTRA_SOURCES)
 include ../../lib.mk
 
 clean:
-	rm -f $(TEST_PROGS) *.o
+	$(RM) $(TEST_PROGS) *.o
diff --git a/tools/testing/selftests/powerpc/switch_endian/Makefile b/tools/testing/selftests/powerpc/switch_endian/Makefile
index e21d106..6cfe0f0 100644
--- a/tools/testing/selftests/powerpc/switch_endian/Makefile
+++ b/tools/testing/selftests/powerpc/switch_endian/Makefile
@@ -15,4 +15,4 @@ check-reversed.S: check-reversed.o
 include ../../lib.mk
 
 clean:
-	rm -f $(TEST_PROGS) *.o check-reversed.S
+	$(RM) $(TEST_PROGS) *.o check-reversed.S
diff --git a/tools/testing/selftests/powerpc/tm/Makefile b/tools/testing/selftests/powerpc/tm/Makefile
index 4bea62a..f04bd4b 100644
--- a/tools/testing/selftests/powerpc/tm/Makefile
+++ b/tools/testing/selftests/powerpc/tm/Makefile
@@ -10,4 +10,4 @@ tm-syscall: CFLAGS += -mhtm -I../../../../../usr/include
 include ../../lib.mk
 
 clean:
-	rm -f $(TEST_PROGS) *.o
+	$(RM) $(TEST_PROGS) *.o
diff --git a/tools/testing/selftests/powerpc/vphn/Makefile b/tools/testing/selftests/powerpc/vphn/Makefile
index a485f2e..d98f32c 100644
--- a/tools/testing/selftests/powerpc/vphn/Makefile
+++ b/tools/testing/selftests/powerpc/vphn/Makefile
@@ -9,4 +9,4 @@ $(TEST_PROGS): ../harness.c
 include ../../lib.mk
 
 clean:
-	rm -f $(TEST_PROGS)
+	$(RM) $(TEST_PROGS)
diff --git a/tools/testing/selftests/ptrace/Makefile b/tools/testing/selftests/ptrace/Makefile
index 453927f..ec5bf58 100644
--- a/tools/testing/selftests/ptrace/Makefile
+++ b/tools/testing/selftests/ptrace/Makefile
@@ -4,7 +4,7 @@ peeksiginfo: peeksiginfo.c
 all: peeksiginfo
 
 clean:
-	rm -f peeksiginfo
+	$(RM) peeksiginfo
 
 TEST_PROGS := peeksiginfo
 
diff --git a/tools/testing/selftests/timers/Makefile b/tools/testing/selftests/timers/Makefile
index 89a3f44..a5889e2 100644
--- a/tools/testing/selftests/timers/Makefile
+++ b/tools/testing/selftests/timers/Makefile
@@ -33,4 +33,4 @@ run_destructive_tests: run_tests
 	./set-2038
 
 clean:
-	rm -f ${bins}
+	$(RM) ${bins}
-- 
1.8.3.4
```

## Re: \[PATCH\] kselftest: replace $(RM) with rm -f command

- From: Kees Cook \<hidden\>
- Date: 2015-09-29 17:45:43 
- Message: https://ratatoskr.run/linux-api/2015/09/4586208.md

```text
On Tue, Sep 29, 2015 at 2:57 AM, Michael Ellerman [ref] wrote:
> On Mon, 2015-09-28 at 03:16 +0000, Mathieu Desnoyers wrote:
>> ----- On Sep 27, 2015, at 10:10 PM, Wang Long long.wanglong-hv44wF8Li93QT0dZR+AlfA@public.gmane.org wrote:
>>
>> > Some test's Makefile using "$(RM)" while the other's
>> > using "rm -f". It is better to use one of them in all
>> > tests.
>>
>> I agree that this disparity appears to be unwanted. We
>> should settle on one or the other.
>>
>> > "rm -f" is better, because it is less magic, and everyone
>> > konws what is does.
>>
>> "$(RM)" is clearly defined as a Makefile implicit variable
>> which defaults to "rm -f".
>> Ref. https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html
>
> Sure, but you had to look it up didn't you :) - I did.
>
>> Leaving it as a variable is more flexible because then the
>> default behavior can be overridden if need be, which is
>> not the case of a hardcoded "rm -f".
>
> But I don't think anyone actually wants to do that. Do they?
>
> Anyway I don't really care either way, so I'm happy for you to do a patch that
> uses $(RM). Or maybe Wang Long will be happy to respin his patch to use $(RM).

Yes, please. $(RM) is preferred, as that is the existing standard and
gives us flexibility.

-Kees

-- 
Kees Cook
Chrome OS Security
```

## Re: \[PATCH\] kselftest: replace $(RM) with rm -f command

- From: Darren Hart \<dvhart@infradead.org\>
- Date: 2015-10-03 04:38:37 
- Message: https://ratatoskr.run/linux-api/2015/10/4589586.md

```text
On Mon, Sep 28, 2015 at 03:16:53AM +0000, Mathieu Desnoyers wrote:
> ----- On Sep 27, 2015, at 10:10 PM, Wang Long long.wanglong-hv44wF8Li93QT0dZR+AlfA@public.gmane.org wrote:
> 
> > Some test's Makefile using "$(RM)" while the other's
> > using "rm -f". It is better to use one of them in all
> > tests.
> 
> I agree that this disparity appears to be unwanted. We
> should settle on one or the other.
> 
> > 
> > "rm -f" is better, because it is less magic, and everyone
> > konws what is does.
> 
> "$(RM)" is clearly defined as a Makefile implicit variable
> which defaults to "rm -f".
> Ref. https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html
> 
> Leaving it as a variable is more flexible because then the
> default behavior can be overridden if need be, which is
> not the case of a hardcoded "rm -f".
> 
> Following your line of argumentation, we should then
> invoke "gcc" directly in every Makefile because it is
> less magic than "$(CC)". This makes no sense.

I don't think they can be compared so simply. Specifying a compiler is a common
use case. Customizing the rm command is not, in my experience anyway, and like
Michael, I would definately have to look up what RM means.

That said, I care more about consistency than which is used. Both are valid, but
$(RM), while more flexible, will cost more people time to look up what it does
as it isn't commonly used than any benefit we're likely to see from its use.

Meh. :-)

-- 
Darren Hart
Intel Open Source Technology Center
```

## Re: \[PATCH\] kselftest: replace $(RM) with rm -f command

- From: Mathieu Desnoyers \<mathieu.desnoyers@efficios.com\>
- Date: 2015-10-03 14:12:14 
- Message: https://ratatoskr.run/linux-api/2015/10/4589747.md

```text
----- On Oct 3, 2015, at 12:38 AM, dvhart dvhart@infradead.org wrote:

> On Mon, Sep 28, 2015 at 03:16:53AM +0000, Mathieu Desnoyers wrote:
>> ----- On Sep 27, 2015, at 10:10 PM, Wang Long long.wanglong@huawei.com wrote:
>> 
>> > Some test's Makefile using "$(RM)" while the other's
>> > using "rm -f". It is better to use one of them in all
>> > tests.
>> 
>> I agree that this disparity appears to be unwanted. We
>> should settle on one or the other.
>> 
>> > 
>> > "rm -f" is better, because it is less magic, and everyone
>> > konws what is does.
>> 
>> "$(RM)" is clearly defined as a Makefile implicit variable
>> which defaults to "rm -f".
>> Ref. https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html
>> 
>> Leaving it as a variable is more flexible because then the
>> default behavior can be overridden if need be, which is
>> not the case of a hardcoded "rm -f".
>> 
>> Following your line of argumentation, we should then
>> invoke "gcc" directly in every Makefile because it is
>> less magic than "$(CC)". This makes no sense.
> 
> I don't think they can be compared so simply. Specifying a compiler is a common
> use case. Customizing the rm command is not, in my experience anyway, and like
> Michael, I would definately have to look up what RM means.
> 
> That said, I care more about consistency than which is used. Both are valid, but
> $(RM), while more flexible, will cost more people time to look up what it does
> as it isn't commonly used than any benefit we're likely to see from its use.
> 
> Meh. :-)

An example is "grm" when you install the opencsw repository
packages on Solaris. In the unlikely example where someone
would have a Solaris machine to build Linux, overriding
various command names, including "rm", can be useful. This
is just one example, there are probably others.

Thanks,

Mathieu

> 
> --
> Darren Hart
> Intel Open Source Technology Center

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
```

## Re: \[PATCH\] kselftest: replace $(RM) with rm -f command

- From: Josh Triplett \<josh@joshtriplett.org\>
- Date: 2015-10-03 17:55:47 
- Message: https://ratatoskr.run/linux-api/2015/10/4589822.md

```text
On Sat, Oct 03, 2015 at 02:11:57PM +0000, Mathieu Desnoyers wrote:
> ----- On Oct 3, 2015, at 12:38 AM, dvhart dvhart-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org wrote:
> 
> > On Mon, Sep 28, 2015 at 03:16:53AM +0000, Mathieu Desnoyers wrote:
> >> ----- On Sep 27, 2015, at 10:10 PM, Wang Long long.wanglong-hv44wF8Li93QT0dZR+AlfA@public.gmane.org wrote:
> >> 
> >> > Some test's Makefile using "$(RM)" while the other's
> >> > using "rm -f". It is better to use one of them in all
> >> > tests.
> >> 
> >> I agree that this disparity appears to be unwanted. We
> >> should settle on one or the other.
> >> 
> >> > 
> >> > "rm -f" is better, because it is less magic, and everyone
> >> > konws what is does.
> >> 
> >> "$(RM)" is clearly defined as a Makefile implicit variable
> >> which defaults to "rm -f".
> >> Ref. https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html
> >> 
> >> Leaving it as a variable is more flexible because then the
> >> default behavior can be overridden if need be, which is
> >> not the case of a hardcoded "rm -f".
> >> 
> >> Following your line of argumentation, we should then
> >> invoke "gcc" directly in every Makefile because it is
> >> less magic than "$(CC)". This makes no sense.
> > 
> > I don't think they can be compared so simply. Specifying a compiler is a common
> > use case. Customizing the rm command is not, in my experience anyway, and like
> > Michael, I would definately have to look up what RM means.
> > 
> > That said, I care more about consistency than which is used. Both are valid, but
> > $(RM), while more flexible, will cost more people time to look up what it does
> > as it isn't commonly used than any benefit we're likely to see from its use.
> > 
> > Meh. :-)
> 
> An example is "grm" when you install the opencsw repository
> packages on Solaris. In the unlikely example where someone
> would have a Solaris machine to build Linux, overriding
> various command names, including "rm", can be useful. This
> is just one example, there are probably others.

Does Solaris rm not support -f?
```

## Re: \[PATCH\] kselftest: replace $(RM) with rm -f command

- From: Mathieu Desnoyers \<mathieu.desnoyers@efficios.com\>
- Date: 2015-10-03 18:05:20 
- Message: https://ratatoskr.run/linux-api/2015/10/4589823.md

```text
----- On Oct 3, 2015, at 1:55 PM, Josh Triplett josh@joshtriplett.org wrote:

> On Sat, Oct 03, 2015 at 02:11:57PM +0000, Mathieu Desnoyers wrote:
>> ----- On Oct 3, 2015, at 12:38 AM, dvhart dvhart@infradead.org wrote:
>> 
>> > On Mon, Sep 28, 2015 at 03:16:53AM +0000, Mathieu Desnoyers wrote:
>> >> ----- On Sep 27, 2015, at 10:10 PM, Wang Long long.wanglong@huawei.com wrote:
>> >> 
>> >> > Some test's Makefile using "$(RM)" while the other's
>> >> > using "rm -f". It is better to use one of them in all
>> >> > tests.
>> >> 
>> >> I agree that this disparity appears to be unwanted. We
>> >> should settle on one or the other.
>> >> 
>> >> > 
>> >> > "rm -f" is better, because it is less magic, and everyone
>> >> > konws what is does.
>> >> 
>> >> "$(RM)" is clearly defined as a Makefile implicit variable
>> >> which defaults to "rm -f".
>> >> Ref. https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html
>> >> 
>> >> Leaving it as a variable is more flexible because then the
>> >> default behavior can be overridden if need be, which is
>> >> not the case of a hardcoded "rm -f".
>> >> 
>> >> Following your line of argumentation, we should then
>> >> invoke "gcc" directly in every Makefile because it is
>> >> less magic than "$(CC)". This makes no sense.
>> > 
>> > I don't think they can be compared so simply. Specifying a compiler is a common
>> > use case. Customizing the rm command is not, in my experience anyway, and like
>> > Michael, I would definately have to look up what RM means.
>> > 
>> > That said, I care more about consistency than which is used. Both are valid, but
>> > $(RM), while more flexible, will cost more people time to look up what it does
>> > as it isn't commonly used than any benefit we're likely to see from its use.
>> > 
>> > Meh. :-)
>> 
>> An example is "grm" when you install the opencsw repository
>> packages on Solaris. In the unlikely example where someone
>> would have a Solaris machine to build Linux, overriding
>> various command names, including "rm", can be useful. This
>> is just one example, there are probably others.
> 
> Does Solaris rm not support -f?

Yes, it does. I was merely showing this as an example where
it can be useful to override the command name, although I don't
expect anyone to have to use "grm" rather than "rm" on that
specific platform.

Thanks,

Mathieu

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
```
