|
28 | 28 | * coded for portability
|
29 | 29 | */
|
30 | 30 |
|
31 |
| -#define RELEASE_DATE "2025-01-05" |
| 31 | +#define RELEASE_DATE "2025-04-02" |
32 | 32 | static char id[] = "\n@(#)$Id: mamake (ksh 93u+m) " RELEASE_DATE " $\0\n";
|
33 | 33 |
|
34 | 34 | #if _PACKAGE_ast
|
@@ -238,6 +238,7 @@ typedef struct Rule_s /* rule item */
|
238 | 238 | int flags; /* RULE_* flags */
|
239 | 239 | int making; /* currently make()ing */
|
240 | 240 | time_t time; /* modification time */
|
| 241 | + time_t parenttime; /* parent's modification time */ |
241 | 242 | unsigned int line; /* starting line in Mamfile */
|
242 | 243 | unsigned int endline; /* ending line in Mamfile */
|
243 | 244 | pid_t pid; /* PID of parallel bg job */
|
@@ -2280,6 +2281,13 @@ static void make(Rule_t *r, Makestate_t *parentstate)
|
2280 | 2281 | propagate(r, NULL, &st.modtime);
|
2281 | 2282 | r->flags |= RULE_updated;
|
2282 | 2283 | }
|
| 2284 | + else if (st.modtime > r->parenttime && r->flags & RULE_generated) |
| 2285 | + { |
| 2286 | + /* if we didn't generate the target in this run, but it's newer than the parent |
| 2287 | + * target, then the generation of the parent target was probably interrupted |
| 2288 | + * and then resumed in this run, so include this target in %{?} for consistency */ |
| 2289 | + r->flags |= RULE_updated; |
| 2290 | + } |
2283 | 2291 | r->flags |= RULE_made;
|
2284 | 2292 | if (!(r->flags & (RULE_dontcare|RULE_error|RULE_exists|RULE_generated|RULE_virtual)))
|
2285 | 2293 | error_making(r, 0);
|
@@ -2390,6 +2398,7 @@ static void make(Rule_t *r, Makestate_t *parentstate)
|
2390 | 2398 | {
|
2391 | 2399 | /* make the target */
|
2392 | 2400 | attributes(q, v);
|
| 2401 | + q->parenttime = r->time; |
2393 | 2402 | make(q, NULL);
|
2394 | 2403 | if (q->pid)
|
2395 | 2404 | {
|
|
0 commit comments