automake-ng
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Automake-NG] [PATCH 4/5] [ng] automake: remove useless code duplication


From: Stefano Lattarini
Subject: [Automake-NG] [PATCH 4/5] [ng] automake: remove useless code duplication
Date: Mon, 30 Jul 2012 15:28:14 +0200

This is a pure refactoring with no semantic changes intended.

* automake.in (handle_all_and_check, handle_tags): Do not re-calculate
the list of "local" input or output header files (specified by
AC_CONFIG_HEADERS in configure.ac); that is already saved in the internal
make variables '$(am.config-hdr.local)' and '$(am.config-hdr.local.in)'.
Simply use these variables instead.

Signed-off-by: Stefano Lattarini <address@hidden>
---
 automake.in | 28 +++-------------------------
 1 file changed, 3 insertions(+), 25 deletions(-)

diff --git a/automake.in b/automake.in
index 1601e07..bf2f845 100644
--- a/automake.in
+++ b/automake.in
@@ -3180,22 +3180,9 @@ 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', INTERNAL,
-                     qw/$(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)/,
-                     @config);
+                     qw/$(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+                        $(am.config-hdr.local.in)/);
 
     if (rvar('am__tagged_files')->value_as_list_recursive
           || var ('ETAGS_ARGS') || var ('SUBDIRS'))
@@ -3900,18 +3887,9 @@ sub handle_footer
 # Generate "make all" and "make check" rules.
 sub handle_all_and_check ()
 {
-  my @local_headers = ();
-  foreach my $spec (@config_headers)
-    {
-      my ($out, @ins) = split_config_file_spec ($spec);
-      push (@local_headers, basename ($out))
-        if dirname ($out) eq $relative_dir;
-    }
-
   almost_verbatim ('all-target',
                    'ALL-DEPS' => "@all",
-                   'LOCAL-HEADERS' => "@local_headers");
-
+                   'LOCAL-HEADERS' => '$(am.config-hdr.local)');
   almost_verbatim ('check-target');
 }
 
-- 
1.7.12.rc0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]