version 1.68, 2020/01/16 16:07:18 |
version 1.69, 2020/01/26 12:41:21 |
|
|
Job_Touch(GNode *gn) |
Job_Touch(GNode *gn) |
{ |
{ |
handle_all_signals(); |
handle_all_signals(); |
if (gn->type & (OP_JOIN|OP_USE|OP_EXEC|OP_OPTIONAL|OP_PHONY)) { |
if (gn->type & (OP_USE|OP_OPTIONAL|OP_PHONY)) { |
/* |
/* |
* .JOIN, .USE, and .OPTIONAL targets are "virtual" targets |
* .JOIN, .USE, and .OPTIONAL targets are "virtual" targets |
* and, as such, shouldn't really be created. |
* and, as such, shouldn't really be created. |
|
|
|
|
for (ln = Lst_First(&gn->children); ln != NULL; ln = Lst_Adv(ln)) { |
for (ln = Lst_First(&gn->children); ln != NULL; ln = Lst_Adv(ln)) { |
child = Lst_Datum(ln); |
child = Lst_Datum(ln); |
if ((child->type & (OP_EXEC|OP_USE|OP_INVISIBLE)) != 0) |
if ((child->type & (OP_USE|OP_INVISIBLE)) != 0) |
continue; |
continue; |
if (OP_NOP(child->type) || |
if (OP_NOP(child->type) || |
(target = Var(TARGET_INDEX, child)) == NULL) { |
(target = Var(TARGET_INDEX, child)) == NULL) { |
|
|
* hosed. |
* hosed. |
*/ |
*/ |
do_oodate = false; |
do_oodate = false; |
if (gn->type & OP_JOIN) { |
if (is_strictly_before(gn->mtime, child->mtime) || |
if (child->built_status == REBUILT) |
|
do_oodate = true; |
|
} else if (is_strictly_before(gn->mtime, child->mtime) || |
|
(!is_strictly_before(child->mtime, starttime) && |
(!is_strictly_before(child->mtime, starttime) && |
child->built_status == REBUILT)) |
child->built_status == REBUILT)) |
do_oodate = true; |
do_oodate = true; |
|
|
|
|
if (gn->impliedsrc) |
if (gn->impliedsrc) |
Var(IMPSRC_INDEX, gn) = Var(TARGET_INDEX, gn->impliedsrc); |
Var(IMPSRC_INDEX, gn) = Var(TARGET_INDEX, gn->impliedsrc); |
|
|
if (gn->type & OP_JOIN) |
|
Var(TARGET_INDEX, gn) = Var(ALLSRC_INDEX, gn); |
|
} |
} |
|
|
/* Wrapper to call Make_TimeStamp from a forEach loop. */ |
/* Wrapper to call Make_TimeStamp from a forEach loop. */ |
|
|
* Certain types of targets needn't even be sought as their datedness |
* Certain types of targets needn't even be sought as their datedness |
* doesn't depend on their modification time... |
* doesn't depend on their modification time... |
*/ |
*/ |
if ((gn->type & (OP_JOIN|OP_USE|OP_EXEC|OP_PHONY)) == 0) { |
if ((gn->type & (OP_USE|OP_PHONY)) == 0) { |
(void)Dir_MTime(gn); |
(void)Dir_MTime(gn); |
if (DEBUG(MAKE)) { |
if (DEBUG(MAKE)) { |
if (!is_out_of_date(gn->mtime)) |
if (!is_out_of_date(gn->mtime)) |
|
|
if (DEBUG(MAKE)) |
if (DEBUG(MAKE)) |
printf(".USE node..."); |
printf(".USE node..."); |
oodate = false; |
oodate = false; |
} else if (gn->type & OP_JOIN) { |
} else if (gn->type & (OP_FORCE|OP_PHONY)) { |
/* |
|
* A target with the .JOIN attribute is only considered |
|
* out-of-date if any of its children was out-of-date. |
|
*/ |
|
if (DEBUG(MAKE)) |
|
printf(".JOIN node..."); |
|
oodate = gn->child_rebuilt; |
|
} else if (gn->type & (OP_FORCE|OP_EXEC|OP_PHONY)) { |
|
/* |
/* |
* A node which is the object of the force (!) operator or which |
* A node which is the object of the force (!) operator or which |
* has the .EXEC attribute is always considered out-of-date. |
* has the .EXEC attribute is always considered out-of-date. |