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 /remake.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 'remake.c')
-rw-r--r-- | remake.c | 28 |
1 files changed, 28 insertions, 0 deletions
@@ -409,6 +409,19 @@ complain (struct file *file) } } +/* Mark the dependencies as considered in this pass (to avoid skipping them + on the next pass). */ +static void +consider_deps (struct dep *d) +{ + for (; d; d = d->next) + { + if (d->file->considered != considered) + consider_deps (d->file->deps); + d->file->considered = considered; + } +} + /* Consider a single 'struct file' and update it as appropriate. Return 0 on success, or non-0 on failure. */ @@ -540,6 +553,13 @@ update_file_1 (struct file *file, unsigned int depth) int maybe_make; int dontcare = 0; + /* The code below will set the state to cs_deps_running. */ + if (d->wait && running) + { + consider_deps(d); + break; + } + check_renamed (d->file); mtime = file_mtime (d->file); @@ -616,6 +636,13 @@ update_file_1 (struct file *file, unsigned int depth) if (must_make || always_make_flag) { for (d = file->deps; d != 0; d = d->next) + { + /* The code below will set the state to cs_deps_running. */ + if (d->wait && running) + { + consider_deps(d); + break; + } if (d->file->intermediate) { enum update_status new; @@ -667,6 +694,7 @@ update_file_1 (struct file *file, unsigned int depth) d->changed = ((file->phony && file->cmds != 0) || file_mtime (d->file) != mtime); } + } } finish_updating (file); |