Updated patch: http://rishi.fedorapeople.org/gnu/0001-New-target-to-generate-cscope-database.patch and inlined below.
Changes: + Removed the -R being passed to cscope. It does, indeed, cause files not owned by the project to be indexed. (Ralf) + Added cscope to AM_RECURSIVE_TARGETS. Should it be cscope and/or cscopelist? (Ralf) + Pass $(CSCOPEFLAGS) and $(AM_CSCOPEFLAGS) to cscope. (Ralf) + Handle generated SOURCES. (Ralf) + Reword the documentation. + Added NEWS entry. (Ralf) + Added ChangeLog entry. + Delete cscope.files at the beginning of 'make cscope' to prevent consecutive runs from adding duplicate entries. (Ralf) TODO: + Test cases. Issues: + I am not sure if cscope can work with $(LISP). Probably not. + Cscope looks for #included headers not found in the source tree under the standard include path (usually /usr/include). More paths can be added using the -I option as mentioned in the man page. On the other hand, this behaviour can be stopped using -k. What do we want to do? >From dffd50442f1d0cb662a67026dd48ace0e2bdddfe Mon Sep 17 00:00:00 2001 From: Debarshi Ray <ri...@gnu.org> Date: Fri, 8 May 2009 08:54:42 +0530 Subject: [PATCH] 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. --- ChangeLog | 16 ++++++++++ Makefile.in | 63 ++++++++++++++++++++++++++++------------ NEWS | 4 ++ automake.in | 18 ++++++++++- doc/Makefile.in | 42 +++++++++++++++++--------- doc/automake.texi | 14 +++++++-- lib/Automake/Makefile.in | 36 ++++++++++++++++------ lib/Automake/tests/Makefile.in | 2 + lib/Makefile.in | 47 ++++++++++++++++++++--------- lib/am/Makefile.in | 2 + lib/am/tags.am | 36 ++++++++++++++++++++++- m4/Makefile.in | 2 + tests/Makefile.in | 2 + 13 files changed, 219 insertions(+), 65 deletions(-) diff --git a/ChangeLog b/ChangeLog index 722ac98..00ceef9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2009-05-07 Debarshi Ray <ri...@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-05-03 Ralf Wildenhues <ralf.wildenh...@gmx.de> Fix copyright years in *.am files. diff --git a/Makefile.in b/Makefile.in index 56a3126..8d6b195 100644 --- a/Makefile.in +++ b/Makefile.in @@ -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) @@ -438,6 +439,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)'; \ @@ -501,8 +506,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) @@ -788,26 +813,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 e806cf6..4d3f9dd 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,10 @@ New in 1.10c: - There is initial support for the Vala programming language, when using Vala 0.7.0 or later. +* New targets: + + - New `cscope' target (builds cscope database). + * Miscellaneous Changes: - In 1.10b, the `parallel-tests' driver introduced per-extension test diff --git a/automake.in b/automake.in index 20ef3bd..b5133b1 100755 --- a/automake.in +++ b/automake.in @@ -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"; } } diff --git a/doc/Makefile.in b/doc/Makefile.in index 6433ad8..877c042 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -532,8 +532,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 \ @@ -764,20 +775,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: diff --git a/doc/automake.texi b/doc/automake.texi index 09a5dd2..e3a7e84 100644 --- a/doc/automake.texi +++ b/doc/automake.texi @@ -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. @@ -9302,7 +9302,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 @@ -9364,6 +9364,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 @@ -12885,4 +12893,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 diff --git a/lib/Automake/Makefile.in b/lib/Automake/Makefile.in index 25c2843..c57fea7 100644 --- a/lib/Automake/Makefile.in +++ b/lib/Automake/Makefile.in @@ -386,6 +386,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)'; \ @@ -449,8 +453,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'`; \ @@ -610,17 +625,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 \ diff --git a/lib/Automake/tests/Makefile.in b/lib/Automake/tests/Makefile.in index 9f3a097..2103667 100644 --- a/lib/Automake/tests/Makefile.in +++ b/lib/Automake/tests/Makefile.in @@ -273,6 +273,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. diff --git a/lib/Makefile.in b/lib/Makefile.in index 3773bd1..e1a286b 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -361,6 +361,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)'; \ @@ -424,8 +428,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'`; \ @@ -585,22 +600,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 diff --git a/lib/am/Makefile.in b/lib/am/Makefile.in index 84d09f0..0ca8c9f 100644 --- a/lib/am/Makefile.in +++ b/lib/am/Makefile.in @@ -268,6 +268,8 @@ TAGS: ctags: CTAGS CTAGS: +cscopelist: + distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ diff --git a/lib/am/tags.am b/lib/am/tags.am index f6661e2..654ddde 100644 --- a/lib/am/tags.am +++ b/lib/am/tags.am @@ -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 diff --git a/m4/Makefile.in b/m4/Makefile.in index bb7bbf9..c03eb14 100644 --- a/m4/Makefile.in +++ b/m4/Makefile.in @@ -265,6 +265,8 @@ TAGS: ctags: CTAGS CTAGS: +cscopelist: + distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ diff --git a/tests/Makefile.in b/tests/Makefile.in index ce8e779..5efcbfc 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -1016,6 +1016,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. -- 1.6.0.6 Happy hacking, Debarshi -- One reason that life is complex is that it has a real part and an imaginary part. -- Andrew Koenig