Viewing: Makefile.codetags

# SPDX-License-Identifier: GPL-2.0

#
# This file is part of Lustre, http://www.lustre.org/
#

FIND_TAG_FILES_CMD = find . \
		     -path ./ldiskfs/linux-stage \
		     -prune -false -o -type f -name '*.[hc]'
TAGS: etags
tags: ctags etags


etags:
	$(RM) TAGS
	ETAGSF=`etags --version | grep -iq exuberant && \
		echo "-I __initdata,__exitdata,EXPORT_SYMBOL"`; \
	$(FIND_TAG_FILES_CMD) | xargs etags $$ETAGSF -a


ctags:
	$(RM) tags
	CTAGSF=`ctags --version | grep -iq exuberant && \
		echo "-I __initdata,__exitdata,EXPORT_SYMBOL"`; \
	$(FIND_TAG_FILES_CMD) | xargs ctags $$CTAGSF -a


#
# autoMakefile carries automake's own cscope recipe, which this one would
# override.  Define it only when autoMakefile was not read - the top-level
# Makefile includes it before this file, so MAKEFILE_LIST already names it
# here - or when cscope was asked for anyway.
#

ifeq (,$(filter autoMakefile, $(MAKEFILE_LIST)))
CSCOPE_WANTED := yes
else
CSCOPE_WANTED := $(filter cscope, $(MAKECMDGOALS))
endif

ifneq (,$(CSCOPE_WANTED))
cscope:
	$(RM) cscope*.out cscope.files
	$(FIND_TAG_FILES_CMD) > cscope.files
	cscope -bRq
endif


mkid:
	$(FIND_TAG_FILES_CMD) | xargs mkid