Skip to content

Commit

Permalink
Merge branch 'tools-ynl-make-clean'
Browse files Browse the repository at this point in the history
Jakub Kicinski says:

====================
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/20240301235609.147572-1-kuba@kernel.org/

====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Mar 6, 2024
2 parents db72b6f + 72fa191 commit b206acf
Showing 4 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions tools/net/ynl/Makefile
Original file line number Diff line number Diff line change
@@ -11,11 +11,11 @@ $(SUBDIRS):
$(MAKE) -C $@ ; \
fi

clean hardclean:
clean distclean:
@for dir in $(SUBDIRS) ; do \
if [ -f "$$dir/Makefile" ] ; then \
$(MAKE) -C $$dir $@; \
fi \
done

.PHONY: clean all $(SUBDIRS)
.PHONY: all clean distclean $(SUBDIRS)
4 changes: 2 additions & 2 deletions tools/net/ynl/generated/Makefile
Original file line number Diff line number Diff line change
@@ -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
5 changes: 3 additions & 2 deletions tools/net/ynl/lib/Makefile
Original file line number Diff line number Diff line change
@@ -17,12 +17,13 @@ ynl.a: $(OBJS)
ar rcs $@ $(OBJS)
clean:
rm -f *.o *.d *~
rm -rf __pycache__

hardclean: clean
distclean: clean
rm -f *.a

%.o: %.c
$(COMPILE.c) -MMD -c -o $@ $<

.PHONY: all clean
.PHONY: all clean distclean
.DEFAULT_GOAL=all
4 changes: 2 additions & 2 deletions tools/net/ynl/samples/Makefile
Original file line number Diff line number Diff line change
@@ -28,8 +28,8 @@ $(BINS): ../lib/ynl.a ../generated/protos.a $(SRCS)
clean:
rm -f *.o *.d *~

hardclean: clean
distclean: clean
rm -f $(BINS)

.PHONY: all clean
.PHONY: all clean distclean
.DEFAULT_GOAL=all

0 comments on commit b206acf

Please sign in to comment.