diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2015-03-24 22:30:52 +0300 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2015-03-24 22:52:20 +0300 |
commit | f312d23f4598097b56883d95d598dc4b502498b7 (patch) | |
tree | 406dc4a095d1b5ba70afb08953c786b370dbf351 /file.c | |
parent | 5e4b4e1c1142a747fa1ba6286639b4d82d80f4ce (diff) | |
download | gunmake-master.tar.gz |
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.c | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -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) { |