public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Extend kbuild/defconfig tags support to exuberant ctags
@ 2006-09-21  4:27 Aron Griffis
  2006-09-24  8:44 ` Sam Ravnborg
  0 siblings, 1 reply; 2+ messages in thread
From: Aron Griffis @ 2006-09-21  4:27 UTC (permalink / raw)
  To: linux-kernel; +Cc: Sam Ravnborg, Masatake YAMATO

The following patch extends kbuild/defconfig tags support to exuberant
ctags.  The previous support is only for emacs ctags/etags programs.

This patch also corrects the kconfig regex for the emacs invocation.
Previously it would miss some instances because it assumed /^config
instead of /^[ \t]*config

Signed-off-by: Aron Griffis <aron@hp.com>

diff -r dc1d277d06e0 -r 8bec009f95de Makefile
--- a/Makefile	Wed Sep 20 04:00:07 2006 +0000
+++ b/Makefile	Thu Sep 21 00:11:02 2006 -0400
@@ -1264,6 +1264,31 @@ define all-defconfigs
 	$(call find-sources,'defconfig')
 endef
 
+define xtags
+	if $1 --version 2>&1 | grep -iq exuberant; then \
+	    $(all-sources) | xargs $1 -a \
+		-I __initdata,__exitdata,__acquires,__releases \
+		-I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL \
+		--extra=+f --c-kinds=+px; \
+	    $(all-kconfigs) | xargs $1 -a \
+		--langdef=kconfig \
+		--language-force=kconfig \
+		--regex-kconfig='/^[[:blank:]]*config[[:blank:]]+([[:alnum:]_]+)/\1/'; \
+	    $(all-defconfigs) | xargs $1 -a \
+		--langdef=dotconfig \
+		--language-force=dotconfig \
+		--regex-dotconfig='/^#?[[:blank:]]*(CONFIG_[[:alnum:]_]+)/\1/'; \
+	elif $1 --version 2>&1 | grep -iq emacs; then \
+	    $(all-sources) | xargs $1 -a; \
+	    $(all-kconfigs) | xargs $1 -a \
+		--regex='/^[ \t]*config[ \t]+\([a-zA-Z0-9_]+\)/\1/'; \
+	    $(all-defconfigs) | xargs $1 -a \
+		--regex='/^#?[ \t]?\(CONFIG_[a-zA-Z0-9_]+\)/\1/'; \
+	else \
+	    $(all-sources) | xargs $1 -a; \
+	fi
+endef
+
 quiet_cmd_cscope-file = FILELST cscope.files
       cmd_cscope-file = (echo \-k; echo \-q; $(all-sources)) > cscope.files
 
@@ -1277,31 +1302,16 @@ quiet_cmd_TAGS = MAKE   $@
 quiet_cmd_TAGS = MAKE   $@
 define cmd_TAGS
 	rm -f $@; \
-	ETAGSF=`etags --version | grep -i exuberant >/dev/null &&     \
-                echo "-I __initdata,__exitdata,__acquires,__releases  \
-                      -I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL              \
-                      --extra=+f --c-kinds=+px"`;                     \
-                $(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
+	$(call xtags,etags)
 endef
 
 TAGS: FORCE
 	$(call cmd,TAGS)
-
 
 quiet_cmd_tags = MAKE   $@
 define cmd_tags
 	rm -f $@; \
-	CTAGSF=`ctags --version | grep -i exuberant >/dev/null &&     \
-                echo "-I __initdata,__exitdata,__acquires,__releases  \
-                      -I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL              \
-                      --extra=+f --c-kinds=+px"`;                     \
-                $(all-sources) | xargs ctags $$CTAGSF -a
+	$(call xtags,ctags)
 endef
 
 tags: FORCE

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Extend kbuild/defconfig tags support to exuberant ctags
  2006-09-21  4:27 Extend kbuild/defconfig tags support to exuberant ctags Aron Griffis
@ 2006-09-24  8:44 ` Sam Ravnborg
  0 siblings, 0 replies; 2+ messages in thread
From: Sam Ravnborg @ 2006-09-24  8:44 UTC (permalink / raw)
  To: Aron Griffis, linux-kernel, Masatake YAMATO

On Thu, Sep 21, 2006 at 12:27:02AM -0400, Aron Griffis wrote:
> The following patch extends kbuild/defconfig tags support to exuberant
> ctags.  The previous support is only for emacs ctags/etags programs.
> 
> This patch also corrects the kconfig regex for the emacs invocation.
> Previously it would miss some instances because it assumed /^config
> instead of /^[ \t]*config

Applied.
But may soon be tempted to factor all TAGS (tags, TAGS, cscope) support
out of top-level Makefile.

	Sam

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-09-24  8:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-21  4:27 Extend kbuild/defconfig tags support to exuberant ctags Aron Griffis
2006-09-24  8:44 ` Sam Ravnborg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox