]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
New target to generate cscope database.
authorDebarshi Ray <rishi@gnu.org>
Fri, 25 Sep 2009 19:39:33 +0000 (21:39 +0200)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Fri, 25 Sep 2009 19:40:03 +0000 (21:40 +0200)
* automake.in (handle_tags): Handle cscope.
* doc/automake.texi (Tags): Document cscope.
* lib/am/tags.am (CSCOPE): New macro.
[TOPDIR_P] (AM_RECURSIVE_TARGETS): Add cscope.
(cscope): New target.
(cscopeclean): Likewise.
(cscope.files): Likewise.
(cscopelist): Likewise.
(distclean-tags): Remove `cscope.out', `cscope.in.out',
`cscope.po.out' and `cscope.files'.
* NEWS: Update.
Based upon earlier patch from Jesse Barnes.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13 files changed:
ChangeLog
Makefile.in
NEWS
automake.in
doc/Makefile.in
doc/automake.texi
lib/Automake/Makefile.in
lib/Automake/tests/Makefile.in
lib/Makefile.in
lib/am/Makefile.in
lib/am/tags.am
m4/Makefile.in
tests/Makefile.in

index 6ed8dc93e2413e6b01a9ddb205ea84231de908e6..f72ad9ea034d061e580581c34542b40406e55aae 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2009-09-25  Debarshi Ray  <rishi@gnu.org>
+
+       New target to generate cscope database.
+       * automake.in (handle_tags): Handle cscope.
+       * doc/automake.texi (Tags): Document cscope.
+       * lib/am/tags.am (CSCOPE): New macro.
+       [TOPDIR_P] (AM_RECURSIVE_TARGETS): Add cscope.
+       (cscope): New target.
+       (cscopeclean): Likewise.
+       (cscope.files): Likewise.
+       (cscopelist): Likewise.
+       (distclean-tags): Remove `cscope.out', `cscope.in.out',
+       `cscope.po.out' and `cscope.files'.
+       * NEWS: Update.
+       Based upon earlier patch from Jesse Barnes.
+
 2009-09-18  Peter Johansson  <trojkan@gmail.com>  (tiny change)
 
        Fix link to "Recursive Make Considered Harmful" paper.
index c522390217875905bec6bb07d93b3fd60b798f7d..b1ab663d94b89315a9cbc26c9bfbcd5f88264301 100644 (file)
@@ -89,9 +89,10 @@ RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive      \
   distclean-recursive maintainer-clean-recursive
 AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
        $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
-       distdir dist dist-all distcheck
+       cscope distdir dist dist-all distcheck
 ETAGS = etags
 CTAGS = ctags
+CSCOPE = cscope
 DIST_SUBDIRS = $(SUBDIRS)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 distdir = $(PACKAGE)-$(VERSION)
@@ -439,6 +440,10 @@ ctags-recursive:
        list='$(SUBDIRS)'; for subdir in $$list; do \
          test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
        done
+cscopelist-recursive:
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+         test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
+       done
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
        list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@@ -502,8 +507,28 @@ GTAGS:
          && $(am__cd) $(top_srcdir) \
          && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscope: cscopeclean cscope.files
+       $(CSCOPE) -b -q $(CSCOPEFLAGS) $(AM_CSCOPEFLAGS) \
+         -i cscope.files $(CSCOPE_ARGS)
+
+cscopeclean:
+       -rm -f cscope.files
+
+cscope.files: cscopelist-recursive cscopelist
+
+cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
+       list='$(SOURCES) $(HEADERS) $(LISP)'; \
+       for i in $$list; do \
+         if test -f "$$i"; \
+           then echo \"$(subdir)/$$i\"; \
+         else \
+           echo \"$(abs_srcdir)/$$i\"; \
+         fi; \
+       done >> $(top_builddir)/cscope.files
+
 distclean-tags:
-       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags cscope.out cscope.in.out \
+       cscope.po.out cscope.files
 
 distdir: $(DISTFILES)
        $(am__remove_distdir)
@@ -792,26 +817,26 @@ ps-am:
 uninstall-am: uninstall-binSCRIPTS
        @$(NORMAL_INSTALL)
        $(MAKE) $(AM_MAKEFLAGS) uninstall-hook
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
-       install-am install-exec-am install-strip tags-recursive \
-       uninstall-am
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \
+       cscopelist-recursive ctags-recursive install-am \
+       install-exec-am install-strip tags-recursive uninstall-am
 
 .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
        all all-am am--refresh check check-am clean clean-generic \
-       ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \
-       dist-hook dist-lzma dist-shar dist-tarZ dist-xz dist-zip \
-       distcheck distclean distclean-generic distclean-tags \
-       distcleancheck distdir distuninstallcheck dvi dvi-am html \
-       html-am info info-am install install-am install-binSCRIPTS \
-       install-data install-data-am install-dvi install-dvi-am \
-       install-exec install-exec-am install-exec-hook install-html \
-       install-html-am install-info install-info-am install-man \
-       install-pdf install-pdf-am install-ps install-ps-am \
-       install-strip installcheck installcheck-am installdirs \
-       installdirs-am maintainer-clean maintainer-clean-generic \
-       mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \
-       tags-recursive uninstall uninstall-am uninstall-binSCRIPTS \
-       uninstall-hook
+       cscope cscopeclean cscopelist cscopelist-recursive ctags \
+       ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-hook \
+       dist-lzma dist-shar dist-tarZ dist-xz dist-zip distcheck \
+       distclean distclean-generic distclean-tags distcleancheck \
+       distdir distuninstallcheck dvi dvi-am html html-am info \
+       info-am install install-am install-binSCRIPTS install-data \
+       install-data-am install-dvi install-dvi-am install-exec \
+       install-exec-am install-exec-hook install-html install-html-am \
+       install-info install-info-am install-man install-pdf \
+       install-pdf-am install-ps install-ps-am install-strip \
+       installcheck installcheck-am installdirs installdirs-am \
+       maintainer-clean maintainer-clean-generic mostlyclean \
+       mostlyclean-generic pdf pdf-am ps ps-am tags tags-recursive \
+       uninstall uninstall-am uninstall-binSCRIPTS uninstall-hook
 
 
 install-exec-hook:
diff --git a/NEWS b/NEWS
index cd427fbed590b986ad1fc794a75c26bd386207c9..4c63fa971d1584807ce3407e234c426a7a1d6d65 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,9 @@
 New in 1.11.0a:
 
+* New targets:
+
+  - New `cscope' target (builds cscope database).
+
 Bugs fixed in 1.11.0a:
 
 * Bugs introduced by 1.11:
index bab8c4222a3f2781e79ab02c7f2fd87bbf4dfb3c..b0a8951bf6564224beacc2a4553e9967a30c01f8 100755 (executable)
@@ -3724,6 +3724,7 @@ sub handle_tags
 {
     my @tag_deps = ();
     my @ctag_deps = ();
+    my @cscope_deps = ();
     if (var ('SUBDIRS'))
     {
        $output_rules .= ("tags-recursive:\n"
@@ -3747,6 +3748,17 @@ sub handle_tags
        push (@ctag_deps, 'ctags-recursive');
        &depend ('.PHONY', 'ctags-recursive');
        &depend ('.MAKE', 'ctags-recursive');
+
+       $output_rules .= ("cscopelist-recursive:\n"
+                         . "\tlist=\'\$(SUBDIRS)\'; for subdir in \$\$list; do \\\n"
+                         # Never fail here if a subdir fails; it
+                         # isn't important.
+                         . "\t  test \"\$\$subdir\" = . || (cd \$\$subdir"
+                         . " && \$(MAKE) \$(AM_MAKEFLAGS) cscopelist); \\\n"
+                         . "\tdone\n");
+       push (@cscope_deps, 'cscopelist-recursive');
+       &depend ('.PHONY', 'cscopelist-recursive');
+       &depend ('.MAKE', 'cscopelist-recursive');
     }
 
     if (&saw_sources_p (1)
@@ -3769,7 +3781,8 @@ sub handle_tags
                                         new Automake::Location,
                                         CONFIG    => "@config",
                                         TAGSDIRS  => "@tag_deps",
-                                        CTAGSDIRS => "@ctag_deps");
+                                        CTAGSDIRS => "@ctag_deps",
+                                        CSCOPEDIRS => "@cscope_deps");
 
        set_seen 'TAGS_DEPENDENCIES';
     }
@@ -3784,8 +3797,9 @@ sub handle_tags
        # Otherwise, it would be possible for a top-level "make TAGS"
        # to fail because some subdirectory failed.
        $output_rules .= "tags: TAGS\nTAGS:\n\n";
-       # Ditto ctags.
+       # Ditto ctags and cscope.
        $output_rules .= "ctags: CTAGS\nCTAGS:\n\n";
+       $output_rules .= "cscopelist:\n\n";
     }
 }
 
index 1deaa306367db7b09ae9024722728117d88e291f..f39bbed19a49d8344f9138daee70b98a876ef5ad 100644 (file)
@@ -533,8 +533,19 @@ GTAGS:
          && $(am__cd) $(top_srcdir) \
          && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+       list='$(SOURCES) $(HEADERS) $(LISP)'; \
+       for i in $$list; do \
+         if test -f "$$i"; \
+           then echo \"$(subdir)/$$i\"; \
+         else \
+           echo \"$(abs_srcdir)/$$i\"; \
+         fi; \
+       done >> $(top_builddir)/cscope.files
+
 distclean-tags:
-       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags cscope.out cscope.in.out \
+       cscope.po.out cscope.files
 
 distdir: $(DISTFILES)
        @list='$(MANS)'; if test -n "$$list"; then \
@@ -765,20 +776,21 @@ uninstall-man: uninstall-man1
 .MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-aminfo \
-       clean-generic ctags dist-info distclean distclean-generic \
-       distclean-tags distdir dvi dvi-am html html-am info info-am \
-       install install-am install-data install-data-am \
-       install-dist_docDATA install-dvi install-dvi-am install-exec \
-       install-exec-am install-html install-html-am install-info \
-       install-info-am install-man install-man1 install-pdf \
-       install-pdf-am install-ps install-ps-am install-strip \
-       installcheck installcheck-am installdirs maintainer-clean \
-       maintainer-clean-aminfo maintainer-clean-generic \
-       maintainer-clean-vti mostlyclean mostlyclean-aminfo \
-       mostlyclean-generic mostlyclean-vti pdf pdf-am ps ps-am tags \
-       uninstall uninstall-am uninstall-dist_docDATA uninstall-dvi-am \
-       uninstall-html-am uninstall-info-am uninstall-man \
-       uninstall-man1 uninstall-pdf-am uninstall-ps-am
+       clean-generic cscopelist ctags dist-info distclean \
+       distclean-generic distclean-tags distdir dvi dvi-am html \
+       html-am info info-am install install-am install-data \
+       install-data-am install-dist_docDATA install-dvi \
+       install-dvi-am install-exec install-exec-am install-html \
+       install-html-am install-info install-info-am install-man \
+       install-man1 install-pdf install-pdf-am install-ps \
+       install-ps-am install-strip installcheck installcheck-am \
+       installdirs maintainer-clean maintainer-clean-aminfo \
+       maintainer-clean-generic maintainer-clean-vti mostlyclean \
+       mostlyclean-aminfo mostlyclean-generic mostlyclean-vti pdf \
+       pdf-am ps ps-am tags uninstall uninstall-am \
+       uninstall-dist_docDATA uninstall-dvi-am uninstall-html-am \
+       uninstall-info-am uninstall-man uninstall-man1 \
+       uninstall-pdf-am uninstall-ps-am
 
 $(dist_man1_MANS): $(top_srcdir)/configure.ac
 $(srcdir)/aclocal.1 $(srcdir)/automake.1:
index f6633d8d84258a59cf79d557ddea422fc1d83b94..4229dc0ceb0f42fc37fcca174b1d889ccd22817d 100644 (file)
@@ -312,7 +312,7 @@ Support for Test Suites
 
 Miscellaneous Rules
 
-* Tags::                        Interfacing to etags and mkid
+* Tags::                        Interfacing to cscope, etags and mkid
 * Suffixes::                    Handling new file extensions
 * Multilibs::                   Support for multilibs.
 
@@ -9320,7 +9320,7 @@ the @code{AM_INIT_AUTOMAKE} macro in @file{configure.ac}.
 There are a few rules and variables that didn't fit anywhere else.
 
 @menu
-* Tags::                        Interfacing to etags and mkid
+* Tags::                        Interfacing to cscope, etags and mkid
 * Suffixes::                    Handling new file extensions
 * Multilibs::                   Support for multilibs.
 @end menu
@@ -9382,6 +9382,14 @@ Automake will also generate an @code{ID} rule that will run
 directory-by-directory basis.
 @trindex id
 
+Similarly, the @code{cscope} rule will create a list of all the source
+files in the tree and run @command{cscope} to build an inverted index
+database.  The variable @code{CSCOPE} is the name of the program to invoke
+(by default @command{cscope}); @code{CSCOPEFLAGS} and
+@code{CSCOPE_ARGS} can be used by the user to pass additional flags and
+file names respectively, while @code{AM_CSCOPEFLAGS} can be used by the
+@file{Makefile.am}.
+
 Finally, Automake also emits rules to support the
 @uref{http://www.gnu.org/software/global/, GNU Global Tags program}.
 The @code{GTAGS} rule runs Global Tags and puts the
@@ -12906,4 +12914,4 @@ parentheses is the number of generated test cases.
 @c  LocalWords:  LTALLOCA MALLOC malloc memcmp strdup alloca libcompat xyz DFOO
 @c  LocalWords:  unprefixed buildable preprocessed DBAZ DDATADIR WARNINGCFLAGS
 @c  LocalWords:  LIBFOOCFLAGS LIBFOOLDFLAGS ftable testSubDir obj LIBTOOLFLAGS
-@c  LocalWords:  barexec Pinard's automatize initialize lzma xz
+@c  LocalWords:  barexec Pinard's automatize initialize lzma xz cscope
index d3192d9ee4b5617252246289a86b2daa63485538..65d23b557fa696145512b8d959d5fe6258a5e679 100644 (file)
@@ -387,6 +387,10 @@ ctags-recursive:
        list='$(SUBDIRS)'; for subdir in $$list; do \
          test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
        done
+cscopelist-recursive:
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+         test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
+       done
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
        list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@@ -450,8 +454,19 @@ GTAGS:
          && $(am__cd) $(top_srcdir) \
          && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
+       list='$(SOURCES) $(HEADERS) $(LISP)'; \
+       for i in $$list; do \
+         if test -f "$$i"; \
+           then echo \"$(subdir)/$$i\"; \
+         else \
+           echo \"$(abs_srcdir)/$$i\"; \
+         fi; \
+       done >> $(top_builddir)/cscope.files
+
 distclean-tags:
-       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags cscope.out cscope.in.out \
+       cscope.po.out cscope.files
 
 distdir: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
@@ -611,17 +626,18 @@ ps-am:
 
 uninstall-am: uninstall-dist_perllibDATA uninstall-nodist_perllibDATA
 
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
-       install-am install-strip tags-recursive
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \
+       cscopelist-recursive ctags-recursive install-am install-strip \
+       tags-recursive
 
 .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-       all all-am check check-am clean clean-generic ctags \
-       ctags-recursive distclean distclean-generic distclean-tags \
-       distdir dvi dvi-am html html-am info info-am install \
-       install-am install-data install-data-am \
-       install-dist_perllibDATA install-dvi install-dvi-am \
-       install-exec install-exec-am install-html install-html-am \
-       install-info install-info-am install-man \
+       all all-am check check-am clean clean-generic cscopelist \
+       cscopelist-recursive ctags ctags-recursive distclean \
+       distclean-generic distclean-tags distdir dvi dvi-am html \
+       html-am info info-am install install-am install-data \
+       install-data-am install-dist_perllibDATA install-dvi \
+       install-dvi-am install-exec install-exec-am install-html \
+       install-html-am install-info install-info-am install-man \
        install-nodist_perllibDATA install-pdf install-pdf-am \
        install-ps install-ps-am install-strip installcheck \
        installcheck-am installdirs installdirs-am maintainer-clean \
index e44898b60abac25af196d6249cef1dc91bcf812d..e217e3fee462ae413df6a57310dff3f9dd9a717b 100644 (file)
@@ -274,6 +274,8 @@ TAGS:
 ctags: CTAGS
 CTAGS:
 
+cscopelist:
+
 
 # To be appended to the command running the test.  Handle the stdout
 # and stderr redirection, and catch the exit status.
index 4eb619e9fabf5393459bcbf34fed4fd3218dfdf3..27fc1e2910a7fbdb93519cbef945c57869171c50 100644 (file)
@@ -362,6 +362,10 @@ ctags-recursive:
        list='$(SUBDIRS)'; for subdir in $$list; do \
          test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
        done
+cscopelist-recursive:
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+         test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
+       done
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
        list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@@ -425,8 +429,19 @@ GTAGS:
          && $(am__cd) $(top_srcdir) \
          && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
+       list='$(SOURCES) $(HEADERS) $(LISP)'; \
+       for i in $$list; do \
+         if test -f "$$i"; \
+           then echo \"$(subdir)/$$i\"; \
+         else \
+           echo \"$(abs_srcdir)/$$i\"; \
+         fi; \
+       done >> $(top_builddir)/cscope.files
+
 distclean-tags:
-       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags cscope.out cscope.in.out \
+       cscope.po.out cscope.files
 
 distdir: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
@@ -586,22 +601,24 @@ ps-am:
 
 uninstall-am: uninstall-dist_pkgvdataDATA uninstall-dist_scriptDATA
 
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
-       install-am install-data-am install-strip tags-recursive
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \
+       cscopelist-recursive ctags-recursive install-am \
+       install-data-am install-strip tags-recursive
 
 .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-       all all-am check check-am clean clean-generic ctags \
-       ctags-recursive distclean distclean-generic distclean-tags \
-       distdir dvi dvi-am html html-am info info-am install \
-       install-am install-data install-data-am install-data-hook \
-       install-dist_pkgvdataDATA install-dist_scriptDATA install-dvi \
-       install-dvi-am install-exec install-exec-am install-html \
-       install-html-am install-info install-info-am install-man \
-       install-pdf install-pdf-am install-ps install-ps-am \
-       install-strip installcheck installcheck-am installcheck-local \
-       installdirs installdirs-am maintainer-clean \
-       maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
-       pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \
+       all all-am check check-am clean clean-generic cscopelist \
+       cscopelist-recursive ctags ctags-recursive distclean \
+       distclean-generic distclean-tags distdir dvi dvi-am html \
+       html-am info info-am install install-am install-data \
+       install-data-am install-data-hook install-dist_pkgvdataDATA \
+       install-dist_scriptDATA install-dvi install-dvi-am \
+       install-exec install-exec-am install-html install-html-am \
+       install-info install-info-am install-man install-pdf \
+       install-pdf-am install-ps install-ps-am install-strip \
+       installcheck installcheck-am installcheck-local installdirs \
+       installdirs-am maintainer-clean maintainer-clean-generic \
+       mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \
+       tags-recursive uninstall uninstall-am \
        uninstall-dist_pkgvdataDATA uninstall-dist_scriptDATA
 
 
index 0ea9842b7cc117e54e2abbfe3314f406b4955bff..616237b940e10e746f7189e54c20c1f291bce79c 100644 (file)
@@ -269,6 +269,8 @@ TAGS:
 ctags: CTAGS
 CTAGS:
 
+cscopelist:
+
 
 distdir: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
index 7463e2f65ebab0962249141f147e1f8fc87309fe..142748bed38e941939d841e846258eba4e59913c 100644 (file)
@@ -134,6 +134,39 @@ GTAGS:
          && gtags -i $(GTAGS_ARGS) "$$here"
 
 
+## ------- ##
+## cscope  ##
+## ------- ##
+
+if %?TOPDIR_P%
+
+CSCOPE = cscope
+.PHONY: cscope cscopeclean
+AM_RECURSIVE_TARGETS += cscope
+
+cscope: cscopeclean cscope.files
+       $(CSCOPE) -b -q $(CSCOPEFLAGS) $(AM_CSCOPEFLAGS) \
+         -i cscope.files $(CSCOPE_ARGS)
+
+cscopeclean:
+       -rm -f cscope.files
+
+cscope.files: %CSCOPEDIRS% cscopelist
+
+endif %?TOPDIR_P%
+
+.PHONY: cscopelist
+cscopelist: %CSCOPEDIRS% $(HEADERS) $(SOURCES) $(LISP)
+       list='$(SOURCES) $(HEADERS) $(LISP)'; \
+       for i in $$list; do \
+         if test -f "$$i"; \
+           then echo \"$(subdir)/$$i\"; \
+         else \
+           echo \"$(abs_srcdir)/$$i\"; \
+         fi; \
+       done >> $(top_builddir)/cscope.files
+
+
 ## ---------- ##
 ## Cleaning.  ##
 ## ---------- ##
@@ -141,4 +174,5 @@ GTAGS:
 .PHONY distclean-am: distclean-tags
 
 distclean-tags:
-       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags cscope.out cscope.in.out \
+       cscope.po.out cscope.files
index be63131daf4b8ef69ef2ad4829086bae7f33b4ee..a7edbd3627f292b98c0235d30a7cf4e37d10b088 100644 (file)
@@ -266,6 +266,8 @@ TAGS:
 ctags: CTAGS
 CTAGS:
 
+cscopelist:
+
 
 distdir: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
index 570b76d1d2b751c904e4ab64ec7c0cb67d9776bc..9cd1666cf8cc384dbcecc32168d7abf2dd3f2105 100644 (file)
@@ -1020,6 +1020,8 @@ TAGS:
 ctags: CTAGS
 CTAGS:
 
+cscopelist:
+
 
 # To be appended to the command running the test.  Handle the stdout
 # and stderr redirection, and catch the exit status.