Index: make1.c =================================================================== --- make1.c (revision 78162) +++ make1.c (working copy) @@ -585,7 +585,8 @@ /* Target has been updated so rescan it for dependencies. */ if ( ( t->fate >= T_FATE_MISSING ) && ( t->status == EXEC_CMD_OK ) && - !t->rescanned ) + !t->rescanned && + !( t->flags & T_FLAG_INTERNAL )) { TARGET * saved_includes; TARGET * target_to_rescan = t; @@ -608,10 +609,6 @@ if ( target_to_rescan->includes ) { - /* Link the old includes on to make sure that it gets - * cleaned up correctly. - */ - target_to_rescan->includes->includes = saved_includes; target_to_rescan->includes->rescanned = 1; /* Tricky. The parents have already been processed, but they * have not seen the internal node, because it was just @@ -624,6 +621,10 @@ * built before this make1a() processing has even started. */ make0( target_to_rescan->includes, target_to_rescan->parents->target, 0, 0, 0 ); + /* Link the old includes on to make sure that it gets + * cleaned up correctly. + */ + target_to_rescan->includes->includes = saved_includes; for ( c = target_to_rescan->parents; c; c = c->next ) c->target->depends = targetentry( c->target->depends, target_to_rescan->includes );