From Kevin Ryde:
authorTom Tromey <tromey@redhat.com>
Thu, 21 Dec 2000 02:09:21 +0000 (02:09 +0000)
committerTom Tromey <tromey@redhat.com>
Thu, 21 Dec 2000 02:09:21 +0000 (02:09 +0000)
* automake.in (handle_footer): Always push user suffixes at the
start of .SUFFIXES:.
* automake.texi (Suffixes): Updated to reflect new suffix
handling.

ChangeLog
automake.in
automake.texi

index 988dd7d..26017c3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2000-12-20  Tom Tromey  <tromey@redhat.com>
+
+       From Kevin Ryde:
+       * automake.in (handle_footer): Always push user suffixes at the
+       start of .SUFFIXES:.
+       * automake.texi (Suffixes): Updated to reflect new suffix
+       handling.
+
 2000-12-18  Tom Tromey  <tromey@redhat.com>
 
        * automake.in (handle_built_sources): Removed.
index c2b89b0..8c3dbe5 100755 (executable)
@@ -3649,13 +3649,6 @@ sub handle_footer
        $output_vars .= "\n";
     }
 
-    if (&variable_defined ('SUFFIXES'))
-    {
-       # Push actual suffixes, and not $(SUFFIXES).  Some versions of
-       # make do not like variable substitutions on the .SUFFIXES
-       # line.
-       push (@suffixes, &variable_value_as_list ('SUFFIXES', ''));
-    }
     if (&target_defined ('.SUFFIXES'))
     {
        &am_line_error ('.SUFFIXES',
@@ -3668,14 +3661,24 @@ sub handle_footer
     $output_header .= ".SUFFIXES:\n";
     if (@suffixes)
     {
+
        # Make sure suffixes has unique elements.  Sort them to ensure
-       # the output remains consistent.
+       # the output remains consistent.  However, $(SUFFIXES) is
+       # always at the start of the list, unsorted.  This is done
+       # because make will choose rules depending on the ordering of
+       # suffixes, and this lets the user have some control.  Push
+       # actual suffixes, and not $(SUFFIXES).  Some versions of make
+       # do not like variable substitutions on the .SUFFIXES line.
        local (%suffixes);
+       local (@user_suffixes) = (&variable_defined ('SUFFIXES')
+                                 ? &variable_value_as_list ('SUFFIXES', '')
+                                 : ());
 
        grep ($suffixes{$_} = 1, @suffixes);
+       delete @suffixes{@user_suffixes};
 
        $output_header .= (".SUFFIXES: "
-                          . join (' ', sort keys %suffixes)
+                          . join (' ', @user_suffixes, sort keys %suffixes)
                           . "\n");
     }
     $output_trailer .= &file_contents ('footer');
index c9c74b4..c099ae8 100644 (file)
@@ -3249,6 +3249,9 @@ source files, you would also need to add these suffixes to the list:
 SUFFIXES = .java .class
 @end example
 
+Any given @code{SUFFIXES} go at the start of the generated suffixes
+list, followed by automake generated suffixes not already in the list.
+
 
 @node Include, Conditionals, Miscellaneous, Top
 @chapter Include