[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 3/8] tags: new var $(am__tagged_files) to list all files to run t
From: |
Stefano Lattarini |
Subject: |
[PATCH 3/8] tags: new var $(am__tagged_files) to list all files to run taggers on |
Date: |
Fri, 8 Jun 2012 10:20:25 +0200 |
This change reduce code duplication a little, and will be needed by
future simplifications.
* automake.in (handle_tags): Define a new 'am__tagged_files' private
make variable that lists all files to run taggers (mkid, cscope, ctags,
etc) on.
* lib/am/tags.am: Use it in several recipes and dependencies list to
reduce code duplication.
Signed-off-by: Stefano Lattarini <address@hidden>
---
automake.in | 17 +++++++++++++++++
lib/am/tags.am | 18 ++++++++----------
2 files changed, 25 insertions(+), 10 deletions(-)
diff --git a/automake.in b/automake.in
index 22fbbd7..cd3d7bc 100644
--- a/automake.in
+++ b/automake.in
@@ -3607,6 +3607,23 @@ sub handle_data
# Handle TAGS.
sub handle_tags
{
+ my @config;
+ foreach my $spec (@config_headers)
+ {
+ my ($out, @ins) = split_config_file_spec ($spec);
+ foreach my $in (@ins)
+ {
+ # If the config header source is in this directory,
+ # require it.
+ push @config, basename ($in)
+ if $relative_dir eq dirname ($in);
+ }
+ }
+
+ define_variable ('am__tagged_files',
+ '$(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)'
+ . "@config", INTERNAL);
+
my @tag_deps = ();
my @ctag_deps = ();
my @cscope_deps = ();
diff --git a/lib/am/tags.am b/lib/am/tags.am
index 9b19eb8..eadb9c0 100644
--- a/lib/am/tags.am
+++ b/lib/am/tags.am
@@ -18,9 +18,9 @@
## ID. ##
## ---- ##
-ID: $(HEADERS) $(SOURCES) %CONFIG% $(TAGS_FILES) $(LISP)
+ID: $(am__tagged_files)
## Make sure the list of sources is unique.
- list='$(SOURCES) %CONFIG% $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
## Handle VPATH correctly.
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
@@ -41,8 +41,7 @@ AM_RECURSIVE_TARGETS += tags TAGS
endif %?SUBDIRS%
tags: TAGS
-TAGS: %TAGSDIRS% $(HEADERS) $(SOURCES) %CONFIG% $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
+TAGS: %TAGSDIRS% $(TAGS_DEPENDENCIES) $(am__tagged_files)
## We use the positional parameters to build the subdir list with
## absolute names, without the need to worry about white space in `pwd`.
set x; \
@@ -68,7 +67,7 @@ TAGS: %TAGSDIRS% $(HEADERS) $(SOURCES) %CONFIG%
$(TAGS_DEPENDENCIES) \
?SUBDIRS? fi; \
?SUBDIRS? done; \
## Make sure the list of sources is unique.
- list='$(SOURCES) $(HEADERS) %CONFIG% $(LISP) $(TAGS_FILES)'; \
+ list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
## Handle VPATH correctly.
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
@@ -104,10 +103,9 @@ ctags: CTAGS
## We have a dummy name here because 'tags' has already been in use
## for a long time to mean Emacs-style tags. Oops. This means the
## dependencies here are useless.
-CTAGS: %CTAGSDIRS% $(HEADERS) $(SOURCES) %CONFIG% $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
+CTAGS: %CTAGSDIRS% $(TAGS_DEPENDENCIES) $(am__tagged_files)
## Make sure the list of sources is unique.
- list='$(SOURCES) $(HEADERS) %CONFIG% $(LISP) $(TAGS_FILES)'; \
+ list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
## Handle VPATH correctly.
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
@@ -153,8 +151,8 @@ cscope.files: clean-cscope %CSCOPEDIRS% cscopelist
endif %?TOPDIR_P%
.PHONY: cscopelist
-cscopelist: %CSCOPEDIRS% $(HEADERS) $(SOURCES) %CONFIG% $(LISP) $(TAGS_FILES)
- list='$(HEADERS) $(SOURCES) %CONFIG% $(LISP) $(TAGS_FILES)'; \
+cscopelist: %CSCOPEDIRS% $(am__tagged_files)
+ list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
--
1.7.9.5
- [PATCH 0/8] {master} Some simplifications in tags support, Stefano Lattarini, 2012/06/08
- [PATCH 3/8] tags: new var $(am__tagged_files) to list all files to run taggers on,
Stefano Lattarini <=
- [PATCH 4/8] tags: look at $(am__tagged_files) to decide whether to activate, Stefano Lattarini, 2012/06/08
- [PATCH 1/8] tags (ID, cscope): also process config header (if any), Stefano Lattarini, 2012/06/08
- [PATCH 2/8] tags (cscope): also process $(TAGS_FILES), Stefano Lattarini, 2012/06/08
- [PATCH 8/8] cleanup: simplify subroutine '&saw_extension', Stefano Lattarini, 2012/06/08
- [PATCH 6/8] cleanup: remove unused '&count_files_for_language' subroutine, Stefano Lattarini, 2012/06/08
- [PATCH 5/8] automake: simplify '&saw_sources_p', Stefano Lattarini, 2012/06/08
- [PATCH 7/8] cleanup: remove subroutine '&saw_sources_p', Stefano Lattarini, 2012/06/08
- Re: [PATCH 0/8] {master} Some simplifications in tags support, Stefano Lattarini, 2012/06/09