diff options
author | Paul Smith <psmith@gnu.org> | 2018-09-09 15:30:07 -0400 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 2018-09-15 15:08:29 -0400 |
commit | 67e6d81256486cbf160208c5b7ea164964c49dd4 (patch) | |
tree | ab67a597be863f129a7c691c1c8c8cd1bd2cbe23 /src/rule.c | |
parent | a1bb739165a944769cbb4a6e4f027ac9c2587122 (diff) | |
download | make-git-67e6d81256486cbf160208c5b7ea164964c49dd4.tar.gz |
[SV 40657] Don't create pattern rules for suffix rules with deps.
* NEWS: Update with a backward-compatibility warning.
* src/rule.c (convert_to_pattern): If a suffix rule has dependencies,
do not create a pattern rule for it. According to the manual suffix
rules with prerequisites are treated as normal targets.
* tests/scrips/features/suffixrules: Create some regression tests for
.SUFFIXES and suffix rules.
Diffstat (limited to 'src/rule.c')
-rw-r--r-- | src/rule.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -252,7 +252,10 @@ convert_to_pattern (void) memcpy (rulename + slen, dep_name (d2), s2len + 1); f = lookup_file (rulename); - if (f == 0 || f->cmds == 0) + + /* No target, or no commands, or it has deps: it can't be a + suffix rule. */ + if (f == 0 || f->cmds == 0 || f->deps != 0) continue; if (s2len == 2 && rulename[slen] == '.' && rulename[slen + 1] == 'a') |