From 9c1b33e74bbb0a6ebcfa66bad80cdaad83a5fdf4 Mon Sep 17 00:00:00 2001 From: Martin Roth Date: Wed, 29 Jul 2015 14:55:18 -0700 Subject: 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 Reviewed-on: http://review.coreboot.org/11074 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich --- Makefile | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 3a1b83a521..421e919326 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 -- cgit v1.2.3