summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2015-03-24 22:30:52 +0300
committerIgor Pashev <pashev.igor@gmail.com>2015-03-24 22:52:20 +0300
commitf312d23f4598097b56883d95d598dc4b502498b7 (patch)
tree406dc4a095d1b5ba70afb08953c786b370dbf351 /file.c
parent5e4b4e1c1142a747fa1ba6286639b4d82d80f4ce (diff)
downloadgunmake-master.tar.gz
Implemented .WAITHEADmaster
Based on this patch: http://lists.gnu.org/archive/html/help-make/2005-04/msg00091.html Test file (wait.mk): simple: 1 .WAIT 2 @echo $@ 1: @sleep 2; echo $@ 2: @echo $@ run: ./make --sun -f wait.mk -j50 simple Output: 1 2 simple
Diffstat (limited to 'file.c')
-rw-r--r--file.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/file.c b/file.c
index fab1d96..9cb5e52 100644
--- a/file.c
+++ b/file.c
@@ -474,6 +474,27 @@ split_prereqs (char *p)
return new;
}
+/* Notice special dependencies. */
+static void
+notice_special_deps(struct dep **d_ptr)
+{
+ struct dep *d;
+
+restart_loop:
+ for (; *d_ptr; d_ptr = &(*d_ptr)->next)
+ {
+ d = *d_ptr;
+ if (!strcmp(d->name, ".WAIT"))
+ {
+ if (d->next)
+ d->next->wait = 1;
+ *d_ptr = d->next;
+ free_dep(d);
+ goto restart_loop;
+ }
+ }
+}
+
/* Given a list of prerequisites, enter them into the file database.
If STEM is set then first expand patterns using STEM. */
struct dep *
@@ -537,6 +558,9 @@ enter_prereqs (struct dep *deps, const char *stem)
}
}
+ if (sun_flag)
+ notice_special_deps(&deps);
+
/* Enter them as files, unless they need a 2nd expansion. */
for (d1 = deps; d1 != 0; d1 = d1->next)
{