diff options
Diffstat (limited to 'miscutils')
-rw-r--r-- | miscutils/make.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/miscutils/make.c b/miscutils/make.c index 1dfbd8c44..8c74d7113 100644 --- a/miscutils/make.c +++ b/miscutils/make.c | |||
@@ -2611,9 +2611,10 @@ make(struct name *np, int level) | |||
2611 | 2611 | ||
2612 | if (!(np->n_flag & N_DOUBLE)) { | 2612 | if (!(np->n_flag & N_DOUBLE)) { |
2613 | // Find the commands needed for a single-colon rule, using | 2613 | // Find the commands needed for a single-colon rule, using |
2614 | // an inference rule or .DEFAULT rule if necessary | 2614 | // an inference rule or .DEFAULT rule if necessary (but, |
2615 | // as an extension, not for phony targets) | ||
2615 | sc_cmd = getcmd(np); | 2616 | sc_cmd = getcmd(np); |
2616 | if (!sc_cmd) { | 2617 | if (!sc_cmd && (posix || !(np->n_flag & N_PHONY))) { |
2617 | impdep = dyndep(np, &imprule); | 2618 | impdep = dyndep(np, &imprule); |
2618 | if (impdep) { | 2619 | if (impdep) { |
2619 | sc_cmd = imprule.r_cmd; | 2620 | sc_cmd = imprule.r_cmd; |
@@ -2623,7 +2624,8 @@ make(struct name *np, int level) | |||
2623 | 2624 | ||
2624 | // As a last resort check for a default rule | 2625 | // As a last resort check for a default rule |
2625 | if (!(np->n_flag & N_TARGET) && np->n_tim.tv_sec == 0) { | 2626 | if (!(np->n_flag & N_TARGET) && np->n_tim.tv_sec == 0) { |
2626 | sc_cmd = getcmd(findname(".DEFAULT")); | 2627 | if (posix || !(np->n_flag & N_PHONY)) |
2628 | sc_cmd = getcmd(findname(".DEFAULT")); | ||
2627 | if (!sc_cmd) { | 2629 | if (!sc_cmd) { |
2628 | if (doinclude) | 2630 | if (doinclude) |
2629 | return 1; | 2631 | return 1; |
@@ -2634,10 +2636,11 @@ make(struct name *np, int level) | |||
2634 | } | 2636 | } |
2635 | else { | 2637 | else { |
2636 | // If any double-colon rule has no commands we need | 2638 | // If any double-colon rule has no commands we need |
2637 | // an inference rule | 2639 | // an inference rule (but, as an extension, not for phony targets) |
2638 | for (rp = np->n_rule; rp; rp = rp->r_next) { | 2640 | for (rp = np->n_rule; rp; rp = rp->r_next) { |
2639 | if (!rp->r_cmd) { | 2641 | if (!rp->r_cmd) { |
2640 | impdep = dyndep(np, &imprule); | 2642 | if (posix || !(np->n_flag & N_PHONY)) |
2643 | impdep = dyndep(np, &imprule); | ||
2641 | if (!impdep) { | 2644 | if (!impdep) { |
2642 | if (doinclude) | 2645 | if (doinclude) |
2643 | return 1; | 2646 | return 1; |