Re: [PATCH] TAGS target for Makefile

Thomas Capricelli (capricel@yalbi.com)
Wed, 24 Nov 1999 19:34:35 +0100


This patch will allow both vi/emacs people to have their tags, 'make
tags' is for vim, and 'make TAGS' is for emacs.

I haven't tested the emacs one. There was a problem with *ksyms.c which
were duplicating symbols in tags, I don't know is 'make TAGS' has this problem.

Why haven't such a patch already made it ? distclean removes it, but
there's no rules for creatings tags/TAGS... Here follow patches for latest 2.2
and 2.3 kernels.

On Wed, 24 Nov 1999, Tigran Aivazian <tigran@sco.COM> wrote:
>and to the rest of the world, as vim can use emacs TAGS as well, of
>course.

This is not exactly true, as I may read in the :help emacs-tags
<quote vi-help>
*emacs-tags* *emacs_tags*
Emacs style tag files are only supported if Vim was compiled with the
|+emacs_tags| feature enabled.
</quote>

My one wasn't...

patch against 2.2.13
--- Makefile-2.2.13 Wed Nov 24 19:59:54 1999
+++ Makefile Wed Nov 24 20:00:34 1999
@@ -303,6 +303,16 @@
fs lib mm ipc kernel drivers net: dummy
$(MAKE) $(subst $@, _dir_$@, $@)

+tags: dummy
+ ctags `find include/asm-$(ARCH) -name '*.h'`
+ for d in `ls include/. | egrep -v '^(asm|config)'`; do find include/$$d -name '*.h' | xargs ctags -a; done
+ find $(SUBDIRS) init -name '*.c' | grep -v ksyms.c | xargs ctags -a
+
+TAGS: dummy
+ etags `find include/asm-$(ARCH) -name '*.h'`
+ for d in `ls include/. | egrep -v '^(asm|config)'`; do find include/$$d -name '*.h' | xargs etags -a; done
+ find $(SUBDIRS) init -name '*.c' | xargs etags -a
+
MODFLAGS += -DMODULE
ifdef CONFIG_MODULES
ifdef CONFIG_MODVERSIONS
@@ -398,7 +408,7 @@
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 \) -print` TAGS
+ -o -name '.*.rej' -o -name '.SUMS' -o -size 0 \) -print` TAGS tags

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

patch against 2.3.29
--- Makefile-2.3.29 Wed Nov 24 19:49:20 1999
+++ Makefile Wed Nov 24 19:57:10 1999
@@ -323,6 +323,16 @@
fs lib mm ipc kernel drivers net: dummy
$(MAKE) $(subst $@, _dir_$@, $@)

+tags: dummy
+ ctags `find include/asm-$(ARCH) -name '*.h'`
+ for d in `ls include/. | egrep -v '^(asm|config)'`; do find include/$$d -name '*.h' | xargs ctags -a; done
+ find $(SUBDIRS) init -name '*.c' | grep -v ksyms.c | xargs ctags -a
+
+TAGS: dummy
+ etags `find include/asm-$(ARCH) -name '*.h'`
+ for d in `ls include/. | egrep -v '^(asm|config)'`; do find include/$$d -name '*.h' | xargs etags -a; done
+ find $(SUBDIRS) init -name '*.c' | xargs etags -a
+
MODFLAGS = -DMODULE
ifdef CONFIG_MODULES
ifdef CONFIG_MODVERSIONS
@@ -426,7 +436,7 @@
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 \) -print` TAGS
+ -o -name '.*.rej' -o -name '.SUMS' -o -size 0 \) -print` TAGS tags

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

Thomas

-- 
Thomas Capricelli

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