diff options
| author | Masatake YAMATO <jet@gyve.org> | 2006-06-21 23:21:20 -0400 |
|---|---|---|
| committer | Sam Ravnborg <sam@mars.ravnborg.org> | 2006-06-24 17:52:05 -0400 |
| commit | e838db685fcfd2e9a0548ffc5cb9447e6c3c11be (patch) | |
| tree | 980366e83c7bf2c9ece3f0ad77eb62dc8ee8fbc5 | |
| parent | 6803dc0ea85ad21b2cb3ec88decff5e27d7a390b (diff) | |
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-- | Makefile | 34 |
1 files changed, 25 insertions, 9 deletions
| @@ -1192,25 +1192,35 @@ endif | |||
| 1192 | 1192 | ||
| 1193 | ALLSOURCE_ARCHS := $(ARCH) | 1193 | ALLSOURCE_ARCHS := $(ARCH) |
| 1194 | 1194 | ||
| 1195 | define all-sources | 1195 | define find-sources |
| 1196 | ( find $(__srctree) $(RCS_FIND_IGNORE) \ | 1196 | ( find $(__srctree) $(RCS_FIND_IGNORE) \ |
| 1197 | \( -name include -o -name arch \) -prune -o \ | 1197 | \( -name include -o -name arch \) -prune -o \ |
| 1198 | -name '*.[chS]' -print; \ | 1198 | -name $1 -print; \ |
| 1199 | for ARCH in $(ALLSOURCE_ARCHS) ; do \ | 1199 | for ARCH in $(ALLSOURCE_ARCHS) ; do \ |
| 1200 | find $(__srctree)arch/$${ARCH} $(RCS_FIND_IGNORE) \ | 1200 | find $(__srctree)arch/$${ARCH} $(RCS_FIND_IGNORE) \ |
| 1201 | -name '*.[chS]' -print; \ | 1201 | -name $1 -print; \ |
| 1202 | done ; \ | 1202 | done ; \ |
| 1203 | find $(__srctree)security/selinux/include $(RCS_FIND_IGNORE) \ | 1203 | find $(__srctree)security/selinux/include $(RCS_FIND_IGNORE) \ |
| 1204 | -name '*.[chS]' -print; \ | 1204 | -name $1 -print; \ |
| 1205 | find $(__srctree)include $(RCS_FIND_IGNORE) \ | 1205 | find $(__srctree)include $(RCS_FIND_IGNORE) \ |
| 1206 | \( -name config -o -name 'asm-*' \) -prune \ | 1206 | \( -name config -o -name 'asm-*' \) -prune \ |
| 1207 | -o -name '*.[chS]' -print; \ | 1207 | -o -name $1 -print; \ |
| 1208 | for ARCH in $(ALLINCLUDE_ARCHS) ; do \ | 1208 | for ARCH in $(ALLINCLUDE_ARCHS) ; do \ |
| 1209 | find $(__srctree)include/asm-$${ARCH} $(RCS_FIND_IGNORE) \ | 1209 | find $(__srctree)include/asm-$${ARCH} $(RCS_FIND_IGNORE) \ |
| 1210 | -name '*.[chS]' -print; \ | 1210 | -name $1 -print; \ |
| 1211 | done ; \ | 1211 | done ; \ |
| 1212 | find $(__srctree)include/asm-generic $(RCS_FIND_IGNORE) \ | 1212 | find $(__srctree)include/asm-generic $(RCS_FIND_IGNORE) \ |
| 1213 | -name '*.[chS]' -print ) | 1213 | -name $1 -print ) |
| 1214 | endef | ||
| 1215 | |||
| 1216 | define all-sources | ||
| 1217 | $(call find-sources,'*.[chS]') | ||
| 1218 | endef | ||
| 1219 | define all-kconfigs | ||
| 1220 | $(call find-sources,'Kconfig*') | ||
| 1221 | endef | ||
| 1222 | define all-defconfigs | ||
| 1223 | $(call find-sources,'defconfig') | ||
| 1214 | endef | 1224 | endef |
| 1215 | 1225 | ||
| 1216 | quiet_cmd_cscope-file = FILELST cscope.files | 1226 | quiet_cmd_cscope-file = FILELST cscope.files |
| @@ -1230,7 +1240,13 @@ define cmd_TAGS | |||
| 1230 | echo "-I __initdata,__exitdata,__acquires,__releases \ | 1240 | echo "-I __initdata,__exitdata,__acquires,__releases \ |
| 1231 | -I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL \ | 1241 | -I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL \ |
| 1232 | --extra=+f --c-kinds=+px"`; \ | 1242 | --extra=+f --c-kinds=+px"`; \ |
| 1233 | $(all-sources) | xargs etags $$ETAGSF -a | 1243 | $(all-sources) | xargs etags $$ETAGSF -a; \ |
| 1244 | if test "x$$ETAGSF" = x; then \ | ||
| 1245 | $(all-kconfigs) | xargs etags -a \ | ||
| 1246 | --regex='/^config[ \t]+\([a-zA-Z0-9_]+\)/\1/'; \ | ||
| 1247 | $(all-defconfigs) | xargs etags -a \ | ||
| 1248 | --regex='/^#?[ \t]?\(CONFIG_[a-zA-Z0-9_]+\)/\1/'; \ | ||
| 1249 | fi | ||
| 1234 | endef | 1250 | endef |
| 1235 | 1251 | ||
| 1236 | TAGS: FORCE | 1252 | TAGS: FORCE |
