aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMasatake YAMATO <jet@gyve.org>2006-06-22 12:21:20 +0900
committerSam Ravnborg <sam@mars.ravnborg.org>2006-06-24 23:52:05 +0200
commite838db685fcfd2e9a0548ffc5cb9447e6c3c11be (patch)
tree980366e83c7bf2c9ece3f0ad77eb62dc8ee8fbc5
parent6803dc0ea85ad21b2cb3ec88decff5e27d7a390b (diff)
downloadkernel_samsung_smdk4412-e838db685fcfd2e9a0548ffc5cb9447e6c3c11be.zip
kernel_samsung_smdk4412-e838db685fcfd2e9a0548ffc5cb9447e6c3c11be.tar.gz
kernel_samsung_smdk4412-e838db685fcfd2e9a0548ffc5cb9447e6c3c11be.tar.bz2
kbuild: adding symbols in Kconfig and defconfig to TAGS
I'm using TAGS generated from "make TAGS" to read the kernel source code. When I met a ifdef block #ifdef CONFIG_FOO ... #endif in the soruce code I would like to know the meaning CONFIG_FOO to decide whether I should read inside the ifdef block or not. meaning CONFIG_FOO is well documented in Kconfig. So it is nice if I can jump to CONFIG_FOO entry in Kconfig from "#ifdef CONFIG_FOO" with the tag jump. Here is the patch to add symbols in Kconfig and defconfig to TAGS in "make TAGS" operation. Signed-off-by: Masatake YAMATO <jet@gyve.org> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
-rw-r--r--Makefile34
1 files changed, 25 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index e890669..a21c319 100644
--- a/Makefile
+++ b/Makefile
@@ -1192,25 +1192,35 @@ endif
ALLSOURCE_ARCHS := $(ARCH)
-define all-sources
- ( find $(__srctree) $(RCS_FIND_IGNORE) \
+define find-sources
+ ( find $(__srctree) $(RCS_FIND_IGNORE) \
\( -name include -o -name arch \) -prune -o \
- -name '*.[chS]' -print; \
+ -name $1 -print; \
for ARCH in $(ALLSOURCE_ARCHS) ; do \
find $(__srctree)arch/$${ARCH} $(RCS_FIND_IGNORE) \
- -name '*.[chS]' -print; \
+ -name $1 -print; \
done ; \
find $(__srctree)security/selinux/include $(RCS_FIND_IGNORE) \
- -name '*.[chS]' -print; \
+ -name $1 -print; \
find $(__srctree)include $(RCS_FIND_IGNORE) \
\( -name config -o -name 'asm-*' \) -prune \
- -o -name '*.[chS]' -print; \
+ -o -name $1 -print; \
for ARCH in $(ALLINCLUDE_ARCHS) ; do \
find $(__srctree)include/asm-$${ARCH} $(RCS_FIND_IGNORE) \
- -name '*.[chS]' -print; \
+ -name $1 -print; \
done ; \
find $(__srctree)include/asm-generic $(RCS_FIND_IGNORE) \
- -name '*.[chS]' -print )
+ -name $1 -print )
+endef
+
+define all-sources
+ $(call find-sources,'*.[chS]')
+endef
+define all-kconfigs
+ $(call find-sources,'Kconfig*')
+endef
+define all-defconfigs
+ $(call find-sources,'defconfig')
endef
quiet_cmd_cscope-file = FILELST cscope.files
@@ -1230,7 +1240,13 @@ define cmd_TAGS
echo "-I __initdata,__exitdata,__acquires,__releases \
-I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL \
--extra=+f --c-kinds=+px"`; \
- $(all-sources) | xargs etags $$ETAGSF -a
+ $(all-sources) | xargs etags $$ETAGSF -a; \
+ if test "x$$ETAGSF" = x; then \
+ $(all-kconfigs) | xargs etags -a \
+ --regex='/^config[ \t]+\([a-zA-Z0-9_]+\)/\1/'; \
+ $(all-defconfigs) | xargs etags -a \
+ --regex='/^#?[ \t]?\(CONFIG_[a-zA-Z0-9_]+\)/\1/'; \
+ fi
endef
TAGS: FORCE