| 199 | static int quit = 0; |
| 200 | |
| 201 | int make1( LIST * targets ) |
| 202 | { |
| 203 | state * pState; |
| 204 | int status = 0; |
| 205 | |
| 206 | memset( (char *)counts, 0, sizeof( *counts ) ); |
| 207 | |
| 208 | { |
| 209 | LISTITER iter, end; |
| 210 | stack temp_stack = { NULL }; |
| 211 | for ( iter = list_begin( targets ), end = list_end( targets ); |
| 212 | iter != end; iter = list_next( iter ) ) |
| 213 | push_state( &temp_stack, bindtarget( list_item( iter ) ), NULL, T_STATE_MAKE1A ); |
| 214 | push_stack_on_stack( &state_stack, &temp_stack ); |
| 215 | } |
| 216 | |
| 217 | /* Clear any state left over from the past */ |
| 218 | quit = 0; |
| 219 | |
| 220 | /* Recursively make the target and its dependencies. */ |
| 221 | |
| 222 | while ( 1 ) |
| 223 | { |
| 224 | while ( ( pState = current_state( &state_stack ) ) ) |
| 225 | { |
| 226 | if ( quit ) |
| 227 | pop_state( &state_stack ); |
| 228 | |
| 229 | switch ( pState->curstate ) |
| 230 | { |
| 231 | case T_STATE_MAKE1A: make1a( pState ); break; |
| 232 | case T_STATE_MAKE1B: make1b( pState ); break; |
| 233 | case T_STATE_MAKE1C: make1c( pState ); break; |
| 234 | default: |
| 235 | assert( !"make1(): Invalid state detected." ); |
| 236 | } |
| 237 | } |
| 238 | if ( !cmdsrunning ) |
| 239 | break; |
| 240 | /* Wait for outstanding commands to finish running. */ |
| 241 | exec_wait(); |
| 242 | } |
| 243 | |
| 244 | clear_state_freelist(); |
| 245 | |
| 246 | /* Talk about it. */ |
| 247 | if ( counts->failed ) |
| 248 | printf( "...failed updating %d target%s...\n", counts->failed, |
| 249 | counts->failed > 1 ? "s" : "" ); |
| 250 | if ( DEBUG_MAKE && counts->skipped ) |
| 251 | printf( "...skipped %d target%s...\n", counts->skipped, |
| 252 | counts->skipped > 1 ? "s" : "" ); |
| 253 | if ( DEBUG_MAKE && counts->made ) |
| 254 | printf( "...updated %d target%s...\n", counts->made, |
| 255 | counts->made > 1 ? "s" : "" ); |
| 256 | |
| 257 | /* If we were interrupted, exit now that all child processes |
| 258 | have finished. */ |
no test coverage detected