From 12dc0f817d5872ca14cf92e5296f2e56e5e8fa0b Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Thu, 21 Dec 2000 02:09:21 +0000 Subject: [PATCH] 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. --- ChangeLog | 8 ++++++++ automake.in | 21 ++++++++++++--------- automake.texi | 3 +++ 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 988dd7d..26017c3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2000-12-20 Tom Tromey + + 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 * automake.in (handle_built_sources): Removed. diff --git a/automake.in b/automake.in index c2b89b0..8c3dbe5 100755 --- a/automake.in +++ b/automake.in @@ -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'); diff --git a/automake.texi b/automake.texi index c9c74b4..c099ae8 100644 --- a/automake.texi +++ b/automake.texi @@ -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 -- 2.7.4