From: Tom Tromey Date: Thu, 28 Aug 1997 15:43:26 +0000 (+0000) Subject: suffix rule fix X-Git-Tag: Release-1-2b~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=51882b2e22dc382b69a7aa292224b955d6dfbedc;p=thirdparty%2Fautomake.git suffix rule fix --- diff --git a/ChangeLog b/ChangeLog index bb055151c..a0f90e774 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Thu Aug 28 09:37:29 1997 Tom Tromey + + From Juergen Erhard: + * automake.in (SUFFIX_RULE_PATTERN): New global. + (handle_single_transform_list): If suffix matches a source suffix, + rewrite. + (read_am_file): Add suffix rules to %suffix_rules. + (initialize_per_input): Initialize %suffix_rules. + Wed Aug 27 12:56:50 1997 Tom Tromey * automake.in (handle_texinfo): Also remove .kys and .ps files. diff --git a/THANKS b/THANKS index 2e66e4d6a..81ebbcbdd 100644 --- a/THANKS +++ b/THANKS @@ -2,6 +2,7 @@ Automake was originally written by David J. MacKenzie . It would not be what it is today without the invaluable help of these people: +"Juergen A. Erhard" "Markus F.X.J. Oberhumer" "Paul D. Smith" Akim Demaille diff --git a/automake.in b/automake.in index af5e46c8a..e736d543d 100755 --- a/automake.in +++ b/automake.in @@ -40,6 +40,7 @@ $IGNORE_PATTERN = "^##([^#].*)?\$"; $WHITE_PATTERN = "^[ \t]*\$"; $COMMENT_PATTERN = "^#"; $RULE_PATTERN = "^([\$a-zA-Z_.][-.a-zA-Z0-9_(){}/\$]*) *:([^=].*|)\$"; +$SUFFIX_RULE_PATTERN = "^\\.([a-zA-Z]+)\\.([a-zA-Z]+)\$"; $MACRO_PATTERN = "^([A-Za-z][A-Za-z0-9_]*)[ \t]*:?=[ \t]*(.*)\$"; $BOGUS_MACRO_PATTERN = "^([^ \t]*)[ \t]*:?=[ \t]*(.*)\$"; $GNITS_VERSION_PATTERN = "[0-9]+\\.[0-9]+([a-z]|\\.[0-9]+)?"; @@ -1147,6 +1148,11 @@ sub handle_single_transform_list $_ .= $obj; $seen_c_source = 1; } + elsif (/\.$source_suffix_pattern$/) + { + # We just rewrite it. Maybe we should do more. + s//.$suffix_rules{$1}/; + } else { # No error message here. Used to have one, but it was @@ -5057,6 +5063,22 @@ sub read_am_file $output_trailer .= $comment . $spacing . $cond_string . $_; $comment = $spacing = ''; $saw_bk = /\\$/; + + # Check the rule for being a suffix rule. If so, store in + # a hash. + + local ($source_suffix); + local ($object_suffix); + + if (($source_suffix, $object_suffix) = ($1 =~ $SUFFIX_RULE_PATTERN)) + { + $suffix_rules{$source_suffix} = $object_suffix; + print "Sources ending in .$source_suffix become .$object_suffix\n" if $verbose; + $source_suffix_pattern = "(" . join('|', keys %suffix_rules) . ")"; + } + + # FIXME: make sure both suffixes are in SUFFIXES? Or set + # SUFFIXES from suffix_rules? } elsif (($is_ok_macro = /$MACRO_PATTERN/o) || /$BOGUS_MACRO_PATTERN/o) @@ -5411,6 +5433,10 @@ sub initialize_per_input # Keys in this hash are the basenames of files which must depend # on ansi2knr. %de_ansi_files = (); + + # This maps the source extension of a suffix rule to its + # corresponding output extension. + %suffix_rules = (); }