usr.bin/make/make.c
/*-
 *-----------------------------------------------------------------------
 * MakeStartJobs --
 *	Start as many jobs as possible.
 *
 * Results:
 *	If the query flag was given to pmake, no job will be started,
 *	but as soon as an out-of-date target is found, this function
 *	returns TRUE. At all other times, this function returns FALSE.
 *
 * Side Effects:
 *	Nodes are removed from the toBeMade queue and job table slots
 *	are filled.
 *
 *-----------------------------------------------------------------------
 */
MakeStartJobs
Start as many jobs as possible.

If the query flag was given to pmake, no job will be started,
but as soon as an out-of-date target is found, this function
returns TRUE. At all other times, this function returns FALSE.

Side Effects:
Nodes are removed from the toBeMade queue and job table slots
are filled.
MakeStartJobs Start as many jobs as possible . If the query flag was given to pmake no job will be started but as soon as an out - of - date target is found this function returns TRUE . At all other times this function returns FALSE . Side Effects : Nodes are removed from the toBeMade queue and job table slots are filled .
static Boolean
MakeStartJobs ()
{
    register GNode	*gn;
    while (!Job_Full() && !Lst_IsEmpty (toBeMade)) {
	gn = (GNode *) Lst_DeQueue (toBeMade);
	if (DEBUG(MAKE)) {
	    printf ("Examining %s...", gn->name);
	}
	if (!Lst_IsEmpty(gn->preds)) {
	    LstNode ln;
	    for (ln = Lst_First(gn->preds); ln != NILLNODE; ln = Lst_Succ(ln)){
		GNode	*pgn = (GNode *)Lst_Datum(ln);
		if (pgn->make && pgn->made == UNMADE) {
		    if (DEBUG(MAKE)) {
			printf("predecessor %s not made yet.\n", pgn->name);
		    }
		    break;
		}
	    }
	    if (ln != NILLNODE) {
		continue;
	    }
	}
	numNodes--;
	if (Make_OODate (gn)) {
	    if (DEBUG(MAKE)) {
		printf ("out-of-date\n");
	    }
	    if (queryFlag) {
		return (TRUE);
	    }
	    Make_DoAllVar (gn);
	    Job_Make (gn);
	} else {
	    if (DEBUG(MAKE)) {
		printf ("up-to-date\n");
	    }
	    gn->made = UPTODATE;
	    if (gn->type & OP_JOIN) {
		Make_DoAllVar (gn);
	    }
	    Make_Update (gn);
	}
    }
    return (FALSE);
}
static Boolean MakeStartJobs ( ) { register GNode * gn ; while ( ! Job_Full ( ) && ! Lst_IsEmpty ( toBeMade ) ) { gn = ( GNode * ) Lst_DeQueue ( toBeMade ) ; if ( DEBUG ( MAKE ) ) { printf ( " " , gn -> name ) ; } if ( ! Lst_IsEmpty ( gn -> preds ) ) { LstNode ln ; for ( ln = Lst_First ( gn -> preds ) ; ln != NILLNODE ; ln = Lst_Succ ( ln ) ) { GNode * pgn = ( GNode * ) Lst_Datum ( ln ) ; if ( pgn -> make && pgn -> made == UNMADE ) { if ( DEBUG ( MAKE ) ) { printf ( " \n " , pgn -> name ) ; } break ; } } if ( ln != NILLNODE ) { continue ; } } numNodes -- ; if ( Make_OODate ( gn ) ) { if ( DEBUG ( MAKE ) ) { printf ( " \n " ) ; } if ( queryFlag ) { return ( TRUE ) ; } Make_DoAllVar ( gn ) ; Job_Make ( gn ) ; } else { if ( DEBUG ( MAKE ) ) { printf ( " \n " ) ; } gn -> made = UPTODATE ; if ( gn -> type & OP_JOIN ) { Make_DoAllVar ( gn ) ; } Make_Update ( gn ) ; } } return ( FALSE ) ; }
MakeStartJobs
      Start as many jobs as possible.
MakeStartJobs Start as many jobs as possible .
/*
	 * Make sure any and all predecessors that are going to be made,
	 * have been.
	 */ /*
	     * If ln isn't nil, there's a predecessor as yet unmade, so we
	     * just drop this node on the floor. When the node in question
	     * has been made, it will notice this node as being ready to
	     * make but as yet unmade and will place the node on the queue.
	     */ /*
		 * Even for an up-to-date .JOIN node, we need it to have its
		 * context variables so references to it get the correct
		 * value for .TARGET when building up the context variables
		 * of its parent(s)...
		 */