aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorAron Griffis <aron@hp.com>2006-09-21 00:27:02 -0400
committerSam Ravnborg <sam@neptun.ravnborg.org>2006-09-25 04:24:20 -0400
commitda7c04083c113c67800f1e13fe92a186e1f9084e (patch)
tree2157eccd667dbd0b2a84830ae7814482879683a3 /Makefile
parent39e6e9cf902462abe624735fd95a51b01ceeda6f (diff)
kbuild: Extend kbuild/defconfig tags support to exuberant ctags
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> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile44
1 files changed, 27 insertions, 17 deletions
diff --git a/Makefile b/Makefile
index cd50298fbda7..13bc589c6056 100644
--- a/Makefile
+++ b/Makefile
@@ -1273,6 +1273,31 @@ define all-defconfigs
1273 $(call find-sources,'defconfig') 1273 $(call find-sources,'defconfig')
1274endef 1274endef
1275 1275
1276define xtags
1277 if $1 --version 2>&1 | grep -iq exuberant; then \
1278 $(all-sources) | xargs $1 -a \
1279 -I __initdata,__exitdata,__acquires,__releases \
1280 -I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL \
1281 --extra=+f --c-kinds=+px; \
1282 $(all-kconfigs) | xargs $1 -a \
1283 --langdef=kconfig \
1284 --language-force=kconfig \
1285 --regex-kconfig='/^[[:blank:]]*config[[:blank:]]+([[:alnum:]_]+)/\1/'; \
1286 $(all-defconfigs) | xargs $1 -a \
1287 --langdef=dotconfig \
1288 --language-force=dotconfig \
1289 --regex-dotconfig='/^#?[[:blank:]]*(CONFIG_[[:alnum:]_]+)/\1/'; \
1290 elif $1 --version 2>&1 | grep -iq emacs; then \
1291 $(all-sources) | xargs $1 -a; \
1292 $(all-kconfigs) | xargs $1 -a \
1293 --regex='/^[ \t]*config[ \t]+\([a-zA-Z0-9_]+\)/\1/'; \
1294 $(all-defconfigs) | xargs $1 -a \
1295 --regex='/^#?[ \t]?\(CONFIG_[a-zA-Z0-9_]+\)/\1/'; \
1296 else \
1297 $(all-sources) | xargs $1 -a; \
1298 fi
1299endef
1300
1276quiet_cmd_cscope-file = FILELST cscope.files 1301quiet_cmd_cscope-file = FILELST cscope.files
1277 cmd_cscope-file = (echo \-k; echo \-q; $(all-sources)) > cscope.files 1302 cmd_cscope-file = (echo \-k; echo \-q; $(all-sources)) > cscope.files
1278 1303
@@ -1286,31 +1311,16 @@ cscope: FORCE
1286quiet_cmd_TAGS = MAKE $@ 1311quiet_cmd_TAGS = MAKE $@
1287define cmd_TAGS 1312define cmd_TAGS
1288 rm -f $@; \ 1313 rm -f $@; \
1289 ETAGSF=`etags --version | grep -i exuberant >/dev/null && \ 1314 $(call xtags,etags)
1290 echo "-I __initdata,__exitdata,__acquires,__releases \
1291 -I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL \
1292 --extra=+f --c-kinds=+px"`; \
1293 $(all-sources) | xargs etags $$ETAGSF -a; \
1294 if test "x$$ETAGSF" = x; then \
1295 $(all-kconfigs) | xargs etags -a \
1296 --regex='/^config[ \t]+\([a-zA-Z0-9_]+\)/\1/'; \
1297 $(all-defconfigs) | xargs etags -a \
1298 --regex='/^#?[ \t]?\(CONFIG_[a-zA-Z0-9_]+\)/\1/'; \
1299 fi
1300endef 1315endef
1301 1316
1302TAGS: FORCE 1317TAGS: FORCE
1303 $(call cmd,TAGS) 1318 $(call cmd,TAGS)
1304 1319
1305
1306quiet_cmd_tags = MAKE $@ 1320quiet_cmd_tags = MAKE $@
1307define cmd_tags 1321define cmd_tags
1308 rm -f $@; \ 1322 rm -f $@; \
1309 CTAGSF=`ctags --version | grep -i exuberant >/dev/null && \ 1323 $(call xtags,ctags)
1310 echo "-I __initdata,__exitdata,__acquires,__releases \
1311 -I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL \
1312 --extra=+f --c-kinds=+px"`; \
1313 $(all-sources) | xargs ctags $$CTAGSF -a
1314endef 1324endef
1315 1325
1316tags: FORCE 1326tags: FORCE