#
debug=
ifeq ($(debug),)
quiet=quiet_
else
quiet=
endif
ifdef SRCDIR
srctree = $(SRCDIR)/
else
srctree = /usr/src/linux/
endif
SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
-e s/arm.*/arm/ -e s/sa110/arm/ \
-e s/s390x/s390/ -e s/parisc64/parisc/ )
ARCH ?= $(SUBARCH)
RCS_FIND_IGNORE := \( -name SCCS -o -name BitKeeper -o -name .svn -o -name CVS -o -name .pc \) -prune -o
ifeq ($(debug),)
define all-sources
( find $(srctree) $(RCS_FIND_IGNORE) \
\( -name include \
-o -name arch \
-o -name drivers \
-o -name sound \
-o -name fs \) -prune -o \
-name '*.[chS]' -print; \
find $(srctree)arch/$(ARCH) $(RCS_FIND_IGNORE) \
-name '*.[chS]' -print; \
find $(srctree)include $(RCS_FIND_IGNORE) \
\( -name config -o -name 'asm-*' \) -prune \
-o -name '*.[chS]' -print; \
find $(srctree)include/asm-$(ARCH) $(RCS_FIND_IGNORE) \
-name '*.[chS]' -print; \
find $(srctree)include/asm-generic $(RCS_FIND_IGNORE) \
-name '*.[chS]' -print; \
find $(srctree)fs -maxdepth 1 $(RCS_FIND_IGNORE) \
-name '*.[chS]' -print; \
find $(srctree)fs/ext2 $(RCS_FIND_IGNORE) \
-name '*.[chS]' -print; \
find $(srctree)fs/proc $(RCS_FIND_IGNORE) \
-name '*.[chS]' -print )
endef
else
# in debug mode only process net/ipv4/*
define all-sources
( find $(srctree)net/ipv4 $(RCS_FIND_IGNORE) \
-name '*.[chS]' -print )
endef
endif
.PHONY: all
all: tags cscope
# If quiet is set, only print short version of command
cmd = @$(if $($(quiet)cmd_$(1)),echo ' $($(quiet)cmd_$(1))' &&) $(cmd_$(1))
quiet_cmd_cscope-file = FILELST cscope.files
cmd_cscope-file = $(all-sources) > cscope.files
quiet_cmd_cscope = MAKE cscope.out
cmd_cscope = cscope -k -b -q
cscope: FORCE
$(call cmd,cscope-file)
$(call cmd,cscope)
quiet_cmd_TAGS = MAKE $@
cmd_TAGS = $(all-sources) | etags -
# Exuberant ctags works better with -I
quiet_cmd_tags = MAKE $@
define cmd_tags
rm -f $@; \
CTAGSF=`ctags --version | grep -i exuberant >/dev/null && echo "-I __initdata,__exitdata,EXPORT_SYMBOL,EXPORT_SYMBOL_GPL --extra=+f"`; \
$(all-sources) | xargs ctags $$CTAGSF -a
endef
TAGS: FORCE
$(call cmd,TAGS)
tags: FORCE
$(call cmd,tags)
clean:
rm -rf tags TAGS cscope*
FORCE:
|