| 164 | static void force_rebuilds( TARGET * t ); |
| 165 | |
| 166 | static void update_dependants( TARGET * t ) |
| 167 | { |
| 168 | TARGETS * q; |
| 169 | |
| 170 | for ( q = t->dependants; q; q = q->next ) |
| 171 | { |
| 172 | TARGET * p = q->target; |
| 173 | char fate0 = p->fate; |
| 174 | |
| 175 | /* If we have already at least begun visiting it and we are not already |
| 176 | * rebuilding it for other reasons. |
| 177 | */ |
| 178 | if ( ( fate0 != T_FATE_INIT ) && ( fate0 < T_FATE_BUILD ) ) |
| 179 | { |
| 180 | p->fate = T_FATE_UPDATE; |
| 181 | |
| 182 | if ( DEBUG_FATE ) |
| 183 | { |
| 184 | printf( "fate change %s from %s to %s (as dependant of %s)\n", |
| 185 | object_str( p->name ), target_fate[ (int) fate0 ], target_fate[ (int) p->fate ], object_str( t->name ) ); |
| 186 | } |
| 187 | |
| 188 | /* If we are done visiting it, go back and make sure its dependants |
| 189 | * get rebuilt. |
| 190 | */ |
| 191 | if ( fate0 > T_FATE_MAKING ) |
| 192 | update_dependants( p ); |
| 193 | } |
| 194 | } |
| 195 | /* Make sure that rebuilds can be chained. */ |
| 196 | force_rebuilds( t ); |
| 197 | } |
| 198 | |
| 199 | |
| 200 | /* |
no test coverage detected