Merge branch 'tools-ynl-make-clean'

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>
This commit is contained in:
David S. Miller 2024-03-06 12:05:11 +00:00
commit b206acf1ff
4 changed files with 9 additions and 8 deletions

View file

@ -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)

View file

@ -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

View file

@ -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

View file

@ -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