From f312d23f4598097b56883d95d598dc4b502498b7 Mon Sep 17 00:00:00 2001 From: Igor Pashev Date: Tue, 24 Mar 2015 22:30:52 +0300 Subject: Implemented .WAIT 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 --- file.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'file.c') 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) { -- cgit v1.2.3