Re: Makefile patch for cscope and saner Ctags

Mark Frazer (mark@somanetworks.com)
Thu, 31 May 2001 16:44:58 -0400


--liOOAslEiF7prFVr
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Khachaturov, Vassilii <Vassilii.Khachaturov@comverse.com> [01/05/31 15:00]:
> Don't forget to bug RH package maintainer on that. Whatever

bugzilla submitted

> I use source-built cscope v.15.1, and -k works for me here,

works for me too!

> WHY?! Isn't it better to put $(shell cat cscope.files) on the list of

I only have a yellow belt in makefile kungfu. These fancy gnu make things
are relatively new to some of us...

The latest patch is attached. include/linux/compile.h seems to get
built whenever I run make, so that's why I've excluded it from the deps
for cscope.out.

--liOOAslEiF7prFVr
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="patch.Makefile"

--- Makefile.old Mon May 28 22:44:01 2001
+++ Makefile Thu May 31 16:29:38 2001
@@ -334,10 +334,41 @@

# Exuberant ctags works better with -I
tags: dummy
- CTAGSF=`ctags --version | grep -i exuberant >/dev/null && echo "-I __initdata,__exitdata,EXPORT_SYMBOL,EXPORT_SYMBOL_NOVERS"`; \
+ CTAGSF=`ctags --version | grep -i exuberant >/dev/null && echo "--sort=no -I __initdata,__exitdata,EXPORT_SYMBOL,EXPORT_SYMBOL_NOVERS"`; \
ctags $$CTAGSF `find include/asm-$(ARCH) -name '*.h'` && \
- find include -type d \( -name "asm-*" -o -name config \) -prune -o -name '*.h' -print | xargs ctags $$CTAGSF -a && \
+ find include -type f -name '*.h' -mindepth 2 -maxdepth 2 \
+ | grep -v include/asm- | grep -v include/config \
+ | xargs -r ctags $$CTAGSF -a && \
+ find include -type f -name '*.h' -mindepth 3 -maxdepth 3 \
+ | grep -v include/asm- | grep -v include/config \
+ | xargs -r ctags $$CTAGSF -a && \
+ find include -type f -name '*.h' -mindepth 4 -maxdepth 4 \
+ | grep -v include/asm- | grep -v include/config \
+ | xargs -r ctags $$CTAGSF -a && \
+ find include -type f -name '*.h' -mindepth 5 -maxdepth 5 \
+ | grep -v include/asm- | grep -v include/config \
+ | xargs -r ctags $$CTAGSF -a && \
find $(SUBDIRS) init -name '*.c' | xargs ctags $$CTAGSF -a
+ mv tags tags.unsorted
+ LC_ALL=C sort -k 1,1 -s tags.unsorted > tags
+ rm tags.unsorted
+
+cscope.files: dummy
+ @find include/asm-$(ARCH) -name '*.h' >.cscope.files
+ @find include $(SUBDIRS) init -type f -name '*.[ch]' \
+ | grep -v include/asm- | grep -v include/config >> .cscope.files
+ @[ -f cscope.files ] || touch cscope.files
+ @if cmp -s .cscope.files cscope.files ; then \
+ /bin/rm .cscope.files ; \
+ else \
+ rm cscope.files ; mv .cscope.files cscope.files ; \
+ fi
+
+.PHONY: cscope
+cscope: cscope.out
+cscope.out: cscope.files \
+ $(shell [ -f cscope.files ] && grep -v include/linux/compile.h cscope.files)
+ cscope -k -b -I include

ifdef CONFIG_MODULES
ifdef CONFIG_MODVERSIONS
@@ -416,7 +447,8 @@
distclean: mrproper
rm -f core `find . \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
-o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
- -o -name '.*.rej' -o -name '.SUMS' -o -size 0 \) -type f -print` TAGS tags
+ -o -name '.*.rej' -o -name '.SUMS' -o -size 0 \) -type f -print` TAGS tags \
+ cscope.files cscope.out

backup: mrproper
cd .. && tar cf - linux/ | gzip -9 > backup.gz

--liOOAslEiF7prFVr--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/