2023-04-21 11:56:20

by Rong Tao

[permalink] [raw]
Subject: [PATCH] tools/counter: Makefile: Remove useless 'include' when make clean

From: Rong Tao <[email protected]>

'make' create 'include' directory, we should remove it when 'make clean'.

Signed-off-by: Rong Tao <[email protected]>
---
tools/counter/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/counter/Makefile b/tools/counter/Makefile
index 8843f0fa6119..e2475a1f10d8 100644
--- a/tools/counter/Makefile
+++ b/tools/counter/Makefile
@@ -39,7 +39,7 @@ $(OUTPUT)counter_example: $(COUNTER_EXAMPLE)

clean:
rm -f $(ALL_PROGRAMS)
- rm -rf $(OUTPUT)include/linux/counter.h
+ rm -rf $(OUTPUT)include
find $(or $(OUTPUT),.) -name '*.o' -delete -o -name '\.*.d' -delete

install: $(ALL_PROGRAMS)
--
2.40.0


2023-04-22 14:21:02

by William Breathitt Gray

[permalink] [raw]
Subject: Re: [PATCH] tools/counter: Makefile: Remove useless 'include' when make clean

Hi Rong,

This is a nitpick, but I think the word "lingering" is better than
"useless" for the title.

On Fri, Apr 21, 2023 at 07:47:25PM +0800, Rong Tao wrote:
> From: Rong Tao <[email protected]>
>
> 'make' create 'include' directory, we should remove it when 'make clean'.

There are a few typos here, so I think you mean something like this:

'make' creates the 'include' directory, so we should remove it on
'make clean'.

>
> Signed-off-by: Rong Tao <[email protected]>
> ---
> tools/counter/Makefile | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/counter/Makefile b/tools/counter/Makefile
> index 8843f0fa6119..e2475a1f10d8 100644
> --- a/tools/counter/Makefile
> +++ b/tools/counter/Makefile
> @@ -39,7 +39,7 @@ $(OUTPUT)counter_example: $(COUNTER_EXAMPLE)
>
> clean:
> rm -f $(ALL_PROGRAMS)
> - rm -rf $(OUTPUT)include/linux/counter.h
> + rm -rf $(OUTPUT)include

The Makefile actually first creates the 'include/linux' directory via
the `mkdir -p` command, and then creates a symbolic link for
'include/linux/counter.h'. It would be more appropriate instead to
unroll these actions here in the `clean` section:

rm -rf $(OUTPUT)include/linux/counter.h
rmdir -p $(OUTPUT)include/linux

William Breathitt Gray

> find $(or $(OUTPUT),.) -name '*.o' -delete -o -name '\.*.d' -delete
>
> install: $(ALL_PROGRAMS)
> --
> 2.40.0
>


Attachments:
(No filename) (1.41 kB)
signature.asc (235.00 B)
Download all attachments

2023-04-22 15:13:22

by Rong Tao

[permalink] [raw]
Subject: Re: [PATCH] tools/counter: Makefile: Remove useless 'include' when make clean

Thanks, William. I submit v2, please review.