summaryrefslogtreecommitdiff
path: root/read.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2009-06-07 17:40:06 +0000
committerPaul Smith <psmith@gnu.org>2009-06-07 17:40:06 +0000
commit0b30c8d9cef18f55e2425e32ffc1552af650a1be (patch)
tree40d5d983e80d10d04bee39765bf904c7b83d0f53 /read.c
parent668af4698040c6524f93165300e0f9a84312ea66 (diff)
downloadgunmake-0b30c8d9cef18f55e2425e32ffc1552af650a1be.tar.gz
- Add a new test suite for LIBPATTERNS
- Fix Savannah bug #21198 - Fix Savannah bug #21823 - Fix Savannah bug #22010
Diffstat (limited to 'read.c')
-rw-r--r--read.c58
1 files changed, 29 insertions, 29 deletions
diff --git a/read.c b/read.c
index 0459f8c..8796dfc 100644
--- a/read.c
+++ b/read.c
@@ -2019,21 +2019,37 @@ record_files (struct nameseq *filenames, const char *pattern,
d_ptr = &(*d_ptr)->next;
if (cmds != 0)
- /* This is the rule with commands, so put its deps
- last. The rationale behind this is that $< expands to
- the first dep in the chain, and commands use $<
- expecting to get the dep that rule specifies. However
- the second expansion algorithm reverses the order thus
- we need to make it last here. */
- (*d_ptr)->next = this;
+ {
+ /* This is the rule with commands, so put its deps
+ last. The rationale behind this is that $< expands to
+ the first dep in the chain, and commands use $<
+ expecting to get the dep that rule specifies. However
+ the second expansion algorithm reverses the order thus
+ we need to make it last here. */
+ (*d_ptr)->next = this;
+ /* This is a hack. I need a way to communicate to
+ snap_deps() that the last dependency line in this
+ file came with commands (so that logic in snap_deps()
+ can put it in front and all this $< -logic works). I
+ cannot simply rely on file->cmds being not 0 because
+ of the cases like the following:
+
+ foo: bar
+ foo:
+ ...
+
+ I am going to temporarily "borrow" UPDATING member in
+ `struct file' for this. */
+ f->updating = 1;
+ }
else
{
- /* This is the rule without commands. Put its
- dependencies at the end but before dependencies from
- the rule with commands (if any). This way everything
- appears in makefile order. */
-
- if (f->cmds != 0)
+ /* This is a rule without commands. If we already have
+ a rule with commands and prerequisites (see "hack"
+ comment above), put these prereqs at the end but
+ before prereqs from the rule with commands. This way
+ everything appears in makefile order. */
+ if (f->updating)
{
this->next = *d_ptr;
*d_ptr = this;
@@ -2044,22 +2060,6 @@ record_files (struct nameseq *filenames, const char *pattern,
}
else
f->deps = this;
-
- /* This is a hack. I need a way to communicate to snap_deps()
- that the last dependency line in this file came with commands
- (so that logic in snap_deps() can put it in front and all
- this $< -logic works). I cannot simply rely on file->cmds
- being not 0 because of the cases like the following:
-
- foo: bar
- foo:
- ...
-
- I am going to temporarily "borrow" UPDATING member in
- `struct file' for this. */
-
- if (cmds != 0)
- f->updating = 1;
}
}
else