diff --git a/src/bjam/builtins.c b/src/bjam/builtins.c index b91061a67..ac983fe9a 100644 --- a/src/bjam/builtins.c +++ b/src/bjam/builtins.c @@ -528,12 +528,15 @@ LIST * builtin_depends( FRAME * frame, int flags ) LIST * const targets = lol_get( frame->args, 0 ); LIST * const sources = lol_get( frame->args, 1 ); + int fate0 = T_FATE_INIT; LISTITER iter = list_begin( targets ); LISTITER end = list_end( targets ); for ( ; iter != end; iter = list_next( iter ) ) { TARGET * const t = bindtarget( list_item( iter ) ); + if (t->fate > fate0) + fate0 = t->fate; if ( flags ) target_include_many( t, sources ); else @@ -558,6 +561,8 @@ LIST * builtin_depends( FRAME * frame, int flags ) s->dependants = targetlist( s->dependants, targets ); } + if (fate0 > T_FATE_INIT) + schedule_targets(sources); return L0; } diff --git a/src/bjam/make1.c b/src/bjam/make1.c index 85d36d86b..faa0b110c 100644 --- a/src/bjam/make1.c +++ b/src/bjam/make1.c @@ -199,6 +199,22 @@ static void push_stack_on_stack( stack * const pDest, stack * const pSrc ) static int intr = 0; static int quit = 0; +void schedule_targets(LIST *targets) +{ + LISTITER iter, end; + stack temp_stack = { NULL }; + for (iter = list_begin(targets), end = list_end(targets); + iter != end && !quit; iter = list_next(iter)) + { + TARGET *t = bindtarget(list_item(iter)); + int anyhow = 0; + if (t->fate == T_FATE_INIT) + make0(t, 0, 0, 0, anyhow, 0); + push_state(&temp_stack, t, NULL, T_STATE_MAKE1A); + } + push_stack_on_stack(&state_stack, &temp_stack); +} + int make1( LIST * targets ) { state * pState;