Skip to content

Commit

Permalink
kbuild: make distclean remove tag files in sub-directories
Browse files Browse the repository at this point in the history
'make tags' and friends create tag files in the top directory, but
people may manually create tag files in sub-directories.

Signed-off-by: Masahiro Yamada <[email protected]>
  • Loading branch information
masahir0y committed May 5, 2021
1 parent 19c8d91 commit 7a02cec
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1511,9 +1511,6 @@ MRPROPER_FILES += include/config include/generated \
signing_key.x509.signer vmlinux-gdb.py \
*.spec

# Directories & files removed with 'make distclean'
DISTCLEAN_FILES += tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS

# clean - Delete most, but leave enough to build external modules
#
clean: rm-files := $(CLEAN_FILES)
Expand All @@ -1540,16 +1537,14 @@ mrproper: clean $(mrproper-dirs)

# distclean
#
distclean: rm-files := $(wildcard $(DISTCLEAN_FILES))

PHONY += distclean

distclean: mrproper
$(call cmd,rmfiles)
@find . $(RCS_FIND_IGNORE) \
\( -name '*.orig' -o -name '*.rej' -o -name '*~' \
-o -name '*.bak' -o -name '#*#' -o -name '*%' \
-o -name 'core' \) \
-o -name 'core' -o -name tags -o -name TAGS -o -name 'cscope*' \
-o -name GPATH -o -name GRTAGS -o -name GSYMS -o -name GTAGS \) \
-type f -print | xargs rm -f


Expand Down

0 comments on commit 7a02cec

Please sign in to comment.