[coreboot-gerrit] New patch to review for coreboot: Add cscope/ctags generation for the current project
Martin Roth (gaumless@gmail.com)
gerrit at coreboot.org
Thu Jul 30 00:12:49 CEST 2015
Martin Roth (gaumless at gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/11074
-gerrit
commit bf65c9c16574bb9b527ff5250fd8088f0fe194ac
Author: Martin Roth <martinroth at google.com>
Date: Wed Jul 29 14:55:18 2015 -0700
Add cscope/ctags generation for the current project
Use the dependency files to generate ctags or cscope data for the
current project instead of the entire coreboot tree.
This isn't completely working for every platform at this point -
while it finds all of the code in the coreboot/src tree, it doesn't
find the code in 3rdparty right now.
Change-Id: Ie8aabcf46c8a69f718940c9e0fd7e7b05c9ce1fb
Signed-off-by: Martin Roth <martinroth at google.com>
---
Makefile | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 3a1b83a..421e919 100644
--- a/Makefile
+++ b/Makefile
@@ -251,6 +251,19 @@ ifndef NOMKDIR
$(shell mkdir -p $(KCONFIG_SPLITCONFIG) $(objk)/lxdialog $(additional-dirs) $(alldirs))
endif
+$(obj)/project_filelist.txt: all
+ find $(obj) -name "*.d" -exec cat {} \; | \
+ sed 's/[:\\]/ /g' | sed 's/ /\n/g' | sort | uniq | \
+ grep -v '\.o$$' > $(obj)/project_filelist.txt
+
+#works with either exuberant ctags or ctags.emacs
+ctags-project: clean-ctags $(obj)/project_filelist.txt
+ cat $(obj)/project_filelist.txt | \
+ xargs ctags -o tags
+
+cscope-project: clean-cscope $(obj)/project_filelist.txt
+ cat $(obj)/project_filelist.txt | xargs cscope -b
+
cscope:
cscope -bR
@@ -274,7 +287,11 @@ clean: clean-for-update clean-target
clean-cscope:
rm -f cscope.out
-distclean: clean
+clean-ctags:
+ rm -f tags
+
+distclean: clean clean-ctags clean-cscope
rm -f .config .config.old ..config.tmp .kconfig.d .tmpconfig* .ccwrap .xcompile
.PHONY: $(PHONY) clean clean-for-update clean-cscope cscope distclean doxygen doxy doxygen_simple
+.PHONY: ctags-project cscope-project clean-ctags
More information about the coreboot-gerrit
mailing list