Skip to contentSkip to conversation

tools: ynl: clean up make clean

PATCH Applied Jakub Kicinski 3 participants 8 messages Mar 5, 2024 – Mar 6, 2024

Subsystems (3)
lore
Share & tools
lore

Jakub Kicinski

author maintainer
#0 lore raw

v2 cover tools: ynl: clean up make clean

First change renames the clean target which removes build results, to a more common name. Second one add missing .PHONY targets. Third one ensures that clean deletes __pycache__.

v2: add patch 2
v1: https://lore.kernel.org/all/[email protected]/

Jakub Kicinski (3):
tools: ynl: rename make hardclean -> distclean
tools: ynl: add distclean to .PHONY in all makefiles
tools: ynl: remove __pycache__ during clean

 tools/net/ynl/Makefile           | 4 ++--
 tools/net/ynl/generated/Makefile | 4 ++--
 tools/net/ynl/lib/Makefile       | 5 +++--
 tools/net/ynl/samples/Makefile   | 4 ++--
 4 files changed, 9 insertions(+), 8 deletions(-)
Signature · 1 line
2.44.0
author maintainer
#1 lore raw

PATCH v2 1/3 tools: ynl: rename make hardclean -> distclean

The make target to remove all generated files used to be called "hardclean" because it deleted files which were tracked by git. We no longer track generated user space files, so use the more common "distclean" name.

---
 tools/net/ynl/Makefile           | 2 +-
 tools/net/ynl/generated/Makefile | 4 ++--
 tools/net/ynl/lib/Makefile       | 2 +-
 tools/net/ynl/samples/Makefile   | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)
tools/net/ynl/Makefile +1 -1
index da1aa10bbcc3..1874296665e1 100644
@@ -11,7 +11,7 @@ samples: | lib generated
 		$(MAKE) -C $@ ; \
 	fi
 
-clean hardclean:
+clean distclean:
 	@for dir in $(SUBDIRS) ; do \
 		if [ -f "$$dir/Makefile" ] ; then \
 			$(MAKE) -C $$dir $@; \
tools/net/ynl/generated/Makefile +2 -2
index 7135028cb449..713f5fb9cc2d 100644
@@ -43,11 +43,11 @@ protos.a: $(OBJS)
 clean:
 	rm -f *.o
 
-hardclean: clean
+distclean: clean
 	rm -f *.c *.h *.a
 
 regen:
 	@../ynl-regen.sh
 
-.PHONY: all clean hardclean regen
+.PHONY: all clean distclean regen
 .DEFAULT_GOAL: all
tools/net/ynl/lib/Makefile +1 -1
index d2e50fd0a52d..2201dafc62b3 100644
@@ -18,7 +18,7 @@ ynl.a: $(OBJS)
 clean:
 	rm -f *.o *.d *~
 
-hardclean: clean
+distclean: clean
 	rm -f *.a
 
 %.o: %.c
tools/net/ynl/samples/Makefile +1 -1
index 1d33e98e3ffe..3e81432f7b27 100644
@@ -28,7 +28,7 @@ $(BINS): ../lib/ynl.a ../generated/protos.a $(SRCS)
 clean:
 	rm -f *.o *.d *~
 
-hardclean: clean
+distclean: clean
 	rm -f $(BINS)
 
 .PHONY: all clean
Signature · 1 line
2.44.0
author maintainer
#3 lore raw

PATCH v2 2/3 tools: ynl: add distclean to .PHONY in all makefiles

In reply to Jakub Kicinski

Donald points out most YNL makefiles are missing distclean in .PHONY, even tho generated/Makefile does list it.

---
v2: new patch

---
 tools/net/ynl/Makefile         | 2 +-
 tools/net/ynl/lib/Makefile     | 2 +-
 tools/net/ynl/samples/Makefile | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
tools/net/ynl/Makefile +1 -1
index 1874296665e1..8e9e09d84e26 100644
@@ -18,4 +18,4 @@ samples: | lib generated
 		fi \
 	done
 
-.PHONY: clean all $(SUBDIRS)
+.PHONY: all clean distclean $(SUBDIRS)
tools/net/ynl/lib/Makefile +1 -1
index 2201dafc62b3..1507833d05c5 100644
@@ -24,5 +24,5 @@ distclean: clean
 %.o: %.c
 	$(COMPILE.c) -MMD -c -o $@ $<
 
-.PHONY: all clean
+.PHONY: all clean distclean
 .DEFAULT_GOAL=all
tools/net/ynl/samples/Makefile +1 -1
index 3e81432f7b27..e194a7565861 100644
@@ -31,5 +31,5 @@ $(BINS): ../lib/ynl.a ../generated/protos.a $(SRCS)
 distclean: clean
 	rm -f $(BINS)
 
-.PHONY: all clean
+.PHONY: all clean distclean
 .DEFAULT_GOAL=all
Signature · 1 line
2.44.0
author maintainer
#5 lore raw

PATCH v2 3/3 tools: ynl: remove __pycache__ during clean

In reply to Jakub Kicinski

Build process uses python to generate the user space code. Remove __pycache__ on make clean.

---
 tools/net/ynl/lib/Makefile | 1 +
 1 file changed, 1 insertion(+)
tools/net/ynl/lib/Makefile +1 -0
index 1507833d05c5..dfff3ecd1cba 100644
@@ -17,6 +17,7 @@ ynl.a: $(OBJS)
 	ar rcs $@ $(OBJS)
 clean:
 	rm -f *.o *.d *~
+	rm -rf __pycache__
 
 distclean: clean
 	rm -f *.a
Signature · 1 line
2.44.0
maintainer Reviewed-by on v2 1/3
#2 lore raw

Re: [PATCH net-next v2 1/3] tools: ynl: rename make hardclean -> distclean

In reply to Jakub Kicinski
Quoted 6 lines · Jakub Kicinski

The make target to remove all generated files used to be called "hardclean" because it deleted files which were tracked by git. We no longer track generated user space files, so use the more common "distclean" name.

#7 lore raw
In reply to Jakub Kicinski
This series was applied to netdev/net-next.git (main) by David S. Miller <[email protected]>:

Hello:

This series was applied to netdev/net-next.git (main) by David S. Miller <[email protected]>:

Quoted 8 lines · On Mon, 4 Mar 2024 21:13:25 -0800 you wrote:

First change renames the clean target which removes build results, to a more common name. Second one add missing .PHONY targets. Third one ensures that clean deletes __pycache__.

v2: add patch 2
v1: https://lore.kernel.org/all/[email protected]/

[...]

Here is the summary with links:
- [net-next,v2,1/3] tools: ynl: rename make hardclean -> distclean

    https://git.kernel.org/netdev/net-next/c/4e887471e8e3
  - [net-next,v2,2/3] tools: ynl: add distclean to .PHONY in all makefiles
    https://git.kernel.org/netdev/net-next/c/1d8617b2a610
  - [net-next,v2,3/3] tools: ynl: remove __pycache__ during clean
    https://git.kernel.org/netdev/net-next/c/72fa191bfdf6

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html