summaryrefslogtreecommitdiff
path: root/rule.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2005-10-24 13:01:39 +0000
committerPaul Smith <psmith@gnu.org>2005-10-24 13:01:39 +0000
commit0029357c24cf818ca2299403c97bc35175e39119 (patch)
tree73dba88903ea90cdac930057fe8619a8a04fb869 /rule.c
parentd6cb11ab36213a7765d3563b27afcc430a35fa40 (diff)
downloadmake-0029357c24cf818ca2299403c97bc35175e39119.tar.gz
Make second expansion optional (partial implementation).
I decided this feature was too impacting to make the permanent default behavior. This set of changes makes the default behavior of make the old behavior (no second expansion). If you want second expansion, you must define the .SECONDEXPANSION: special target before the first target that needs it. This set of changes ONLY fixes explicit and static pattern rules to work like this. Implicit rules still have second expansion enabled all the time: I'll work on that next. Note that there is still a backward-incompatibility: now to get the old SysV behavior using $$@ etc. in the prerequisites list you need to set .SECONDEXPANSION: as well.
Diffstat (limited to 'rule.c')
-rw-r--r--rule.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/rule.c b/rule.c
index 152e7e66..235e470f 100644
--- a/rule.c
+++ b/rule.c
@@ -206,6 +206,7 @@ convert_suffix_rule (char *target, char *source, struct commands *cmds)
deps->next = 0;
deps->name = depname;
deps->ignore_mtime = 0;
+ deps->staticpattern = 0;
deps->need_2nd_expansion = 0;
}
@@ -476,8 +477,8 @@ create_pattern_rule (char **targets, char **target_percents,
int terminal, struct dep *deps,
struct commands *commands, int override)
{
- register struct rule *r = (struct rule *) xmalloc (sizeof (struct rule));
- register unsigned int max_targets, i;
+ unsigned int max_targets, i;
+ struct rule *r = (struct rule *) xmalloc (sizeof (struct rule));
r->cmds = commands;
r->deps = deps;