Lines Matching defs:target

78 extern	Doname		doname_check(register Name target, register Boolean do_get, register Boolean implicit, register Boolean automatic);
79 extern Doname doname(register Name target, register Boolean do_get, register Boolean implicit, register Boolean automatic);
80 static Boolean check_dependencies(Doname *result, Property line, Boolean do_get, Name target, Name true_target, Boolean doing_subtree, Chain *out_of_date_tail, Property old_locals, Boolean implicit, Property *command, Name less, Boolean rechecking_target, Boolean recheck_conditionals);
81 void dynamic_dependencies(Name target);
88 static void do_assign(register Name line, register Name target);
89 static void build_command_strings(Name target, register Property line);
90 static Doname touch_command(register Property line, register Name target, Doname result);
92 static Doname sccs_get(register Name target, register Property *command);
94 static void add_pattern_conditionals(register Name target);
95 extern void set_locals(register Name target, register Property old_locals);
96 extern void reset_locals(register Name target, register Property old_locals, register Property conditional, register int index);
97 extern Boolean check_auto_dependencies(Name target, int auto_count, Name *automatics);
108 * doname_check(target, do_get, implicit, automatic)
116 * target The target to build
127 doname_check(register Name target, register Boolean do_get, register Boolean implicit, register Boolean automatic)
132 switch (doname(target, do_get, implicit, automatic)) {
142 target->string_mb);
151 * We later declare the target to be out of date just in
167 warning(gettext("Don't know how to make target `%s'"),
168 target->string_mb);
172 fatal(gettext("Don't know how to make target `%s'"), target->string_mb);
182 enter_explicit_rule_from_dynamic_rule(Name target, Name source)
188 line = maybe_append_prop(target, line_prop);
190 line->body.line.target = target;
198 line->body.line.less = target;
206 find_dyntarget(Name target)
214 Wstring wcb(target);
227 enter_explicit_rule_from_dynamic_rule(target, p->name);
228 return(target);
242 enter_explicit_rule_from_dynamic_rule(target, p->name);
243 return(target);
256 * doname(target, do_get, implicit)
258 * Chases all files the target depends on and builds any that
259 * are out of date. If the target is out of date it is then rebuilt.
265 * target Target to build
281 doname(register Name target, register Boolean do_get, register Boolean implicit, register Boolean automatic)
291 Name true_target = target;
302 if (target->state == build_running) {
305 line = get_prop(target->prop, line_prop);
308 * If this target is a member of target group and one of the
309 * other members of the group is running, mark this target
316 target->state = build_running;
317 add_pending(target,
327 * If the target is a constructed one for a "::" target,
330 if (target->has_target_prop) {
331 true_target = get_prop(target->prop,
332 target_prop)->body.target.target;
345 * If the target has been processed, we don't need to do it again,
349 if (target->state == build_ok) {
350 if((!keep_state || (!target->depends_on_conditional && !assign_done))) {
356 if (target->state == build_subtree) {
358 target->state = build_dont_know;
360 if (!target->checking_subtree) {
362 * This target has been started before and therefore
367 } else if (target->state == build_pending) {
368 target->state = build_dont_know;
373 (target->conditional_cnt > 0)) {
374 if (!parallel_ok(target, false)) {
375 add_subtree(target, recursion_level, do_get, implicit);
376 target->state = build_running;
382 * If KEEP_STATE is on, we have to rebuild the target if the
398 * If this target has never been built before, mark all
407 /* Save the set of automatic depes defined for this target */
440 target->string_mb);
444 if (target->state == build_in_progress) {
446 target->string_mb);
449 target->state = build_in_progress;
451 /* Activate conditional macros for the target */
452 if (!target->added_pattern_conditionals) {
453 add_pattern_conditionals(target);
454 target->added_pattern_conditionals = true;
456 if (target->conditional_cnt > 0) {
457 old_locals = (Property) alloca(target->conditional_cnt *
459 set_locals(target, old_locals);
464 * target names that are same as file name. In this case $$@ in the
468 if (!target->has_depe_list_expanded)
470 dynamic_dependencies(target);
477 if ((line = get_prop(target->prop, line_prop)) != NULL) {
481 target,
501 * If the target is a :: type, do not try to find the rule for the target,
506 * [tolik, 12 Sep 2002] Do not try to find implicit rule for the target
507 * being rechecked - the target is being rechecked means that it already
511 if (target->colon_splits == 0 && !rechecking_target) {
516 target,
523 target->state = build_running;
524 add_pending(target,
529 if (target->conditional_cnt > 0) {
530 reset_locals(target,
532 get_prop(target->prop,
546 if (target->is_member &&
547 ((member = get_prop(target->prop, member_prop)) !=
549 switch (find_ar_suffix_rule(target,
558 target->state = build_running;
559 add_pending(target,
564 if (target->conditional_cnt > 0) {
565 reset_locals(target,
567 get_prop(target->prop,
577 maybe_append_prop(target,
585 switch (find_double_suffix_rule(target,
592 target->state = build_running;
593 add_pending(target,
598 if (target->conditional_cnt > 0) {
599 reset_locals(target,
601 get_prop(target->
618 * If more than one percent rules are defined for the same target then
624 * going to say "don't know how to make target" it sets second_pass to true and
629 ((line->body.line.target != NULL) &&
630 !line->body.line.target->has_regular_dependency))) {
631 switch (find_suffix_rule(target,
632 target,
640 target->state = build_running;
641 add_pending(target,
646 if (target->conditional_cnt > 0) {
647 reset_locals(target,
649 get_prop(target->prop,
660 result = sccs_get(target, &command);
670 line = maybe_append_prop(target, line_prop);
691 line->body.line.target = true_target;
698 /* We say "target up to date" if no cmd were executed for the target */
699 if (!target->is_double_colon_parent) {
709 silent = (Boolean) target->silent_mode;
713 ignore_errors = (Boolean) target->ignore_error_mode;
728 add_running(target,
736 target->state = build_running;
737 if ((line = get_prop(target->prop,
744 if (target->conditional_cnt > 0) {
745 reset_locals(target,
747 get_prop(target->prop,
753 add_serial(target,
757 target->state = build_running;
758 line = get_prop(target->prop, line_prop);
765 if (target->conditional_cnt > 0) {
766 reset_locals(target,
768 get_prop(target->prop,
782 * If no command was found for the target, and it doesn't
783 * exist, and it is mentioned as a target in the makefile,
786 if (target->colons != no_colon) {
797 Name dtarg = find_dyntarget(target);
799 if (!target->has_depe_list_expanded) {
800 dynamic_dependencies(target);
802 if ((line = get_prop(target->prop, line_prop)) != NULL) {
806 target,
831 (void) exists(target);
832 if ((target->stat.time != file_doesnt_exist) &&
843 if ((line = get_prop(target->prop, line_prop)) != NULL) {
849 target->state = result;
851 if (target->conditional_cnt > 0) {
852 reset_locals(target,
854 get_prop(target->prop, conditional_prop),
858 if (target->is_member) {
862 if ((target->stat.time != file_max_time) &&
863 ((member = get_prop(target->prop, member_prop)) != NULL) &&
865 target->stat.time =
871 * built the target.
873 if ((result == build_ok) && check_auto_dependencies(target,
898 * target, true_target, doing_subtree, out_of_date_tail,
908 * target The target to chase dependencies for
926 check_dependencies(Doname *result, Property line, Boolean do_get, Name target, Name true_target, Boolean doing_subtree, Chain *out_of_date_tail, Property old_locals, Boolean implicit, Property *command, Name less, Boolean rechecking_target, Boolean recheck_conditionals)
950 (rechecking_target || target->rechecking_target)) {
959 * The special target .WAIT means finish all of
1014 * is out of date. In this case, we just declare the target out of date
1015 * and go on. If we really need the dependency, the make'ing of the target
1037 target->depends_on_conditional = true;
1040 target->stat.time =
1149 if (target->conditional_cnt > 0) {
1150 reset_locals(target,
1152 get_prop(target->prop,
1158 target->state = build_running;
1159 add_pending(target,
1164 if (target->conditional_cnt > 0) {
1165 reset_locals(target,
1167 get_prop(target->prop,
1175 * Collect the timestamp of the youngest double colon target
1178 if (target->is_double_colon_parent) {
1186 target->stat.time =
1188 target->stat.time);
1202 warning(gettext("Too many rules defined for target %s"),
1203 target->string_mb);
1206 /* Check if the target is out of date */
1221 line->body.line.target = true_target;
1240 ((member = get_prop(target->prop, member_prop)) !=
1277 * dynamic_dependencies(target)
1281 * Here, "$@" gets translated to target->string. That is
1299 * target Target to sanitize dependencies for
1308 dynamic_dependencies(Name target)
1326 Name true_target = target;
1329 if ((line = get_prop(target->prop, line_prop)) == NULL) {
1332 /* If the target is constructed from a "::" target we consider that */
1333 if (target->has_target_prop) {
1334 true_target = get_prop(target->prop,
1335 target_prop)->body.target.target;
1344 target->has_depe_list_expanded = true;
1346 /* The make macro $@ is bound to the target name once per */
1422 (void) printf(gettext("%*sDynamic dependency `%s' for target `%s'\n"),
1457 (void) printf(gettext("%*sDynamic dependency `%s' for target `%s'\n"),
1553 * current_target Set to the target we run a command for
1571 register Name target = line->body.line.target;
1575 if (!line->body.line.is_out_of_date && target->rechecking_target) {
1576 target->rechecking_target = false;
1581 * Build the command if we know the target is out of date,
1587 build_command_strings(target, line);
1594 /* If quest, then exit(1) because the target is out of date */
1612 (target->stat.time != file_doesnt_exist) &&
1613 ((target->stat.mode & 0222) != 0)) {
1615 target->string_mb);
1616 target->has_complained = remember_only = true;
1644 int len = 2*MAXPATHLEN + strlen(target->string_mb) + 2;
1653 MBSTOWCS(to, target->string_mb);
1666 current_target = target;
1675 result = touch_command(line, target, result);
1682 * proper command(s) for the target.
1685 if (!parallel_ok(target, true)) {
1688 * this target must be built in serial.
1695 result = execute_parallel(line, true, target->localhost);
1712 result = execute_parallel(line, true, target->localhost);
1716 target->parallel = false;
1724 result = execute_parallel(line, true, target->localhost);
1739 * Runs thru the command line for the target and
1767 Name target = line->body.line.target;
1769 target->has_recursive_dependency = false;
1805 do_assign(rule->command_line, target);
1817 target);
1830 fatal(gettext("Command failed for target `%s'"),
1831 target->string_mb);
2061 * do_assign(line, target)
2067 * target The Name of the target, used for error reports
2073 do_assign(register Name line, register Name target)
2108 fatal(gettext("= expected in rule `%s' for target `%s'"),
2110 target->string_mb);
2128 * build_command_strings(target, line)
2131 * building a target. If the string is different from the previous one
2135 * target Target to build commands for
2156 build_command_strings(Name target, register Property line)
2182 /* We have to check if a target depends on conditional macros */
2184 /* since the macro values used when building the target might have */
2187 /* If we are building a lib.a(member) target $@ should be bound */
2189 if (target->is_member &&
2190 ((member = get_prop(target->prop, member_prop)) != NULL)) {
2191 target = member->body.member.library;
2193 /* If we are building a "::" help target $@ should be bound to */
2194 /* the real target name */
2195 /* A lib.a(member) target is never :: */
2196 if (target->has_target_prop) {
2197 target = get_prop(target->prop, target_prop)->
2198 body.target.target;
2201 tmp_name = target;
2405 target->string_mb,
2416 target->string_mb,
2441 target->string_mb);
2456 target->string_mb);
2476 target->conditional_macro_list = cond_macro_list;
2478 target->depends_on_conditional = true;
2483 * touch_command(line, target, result)
2486 * We touch all targets in the target group ("foo + fie:") if any.
2493 * target The target we are touching
2501 touch_command(register Property line, register Name target, Doname result)
2510 for (name = target, target_group = NULL; name != NULL;) {
2571 * updates the status of a target after executing its commands.
2584 Name target;
2593 * target is a symlink and sccs file is newer then target.
2602 target = line->body.line.target;
2607 (target->is_member &&
2612 /* new timestamp for the target we didnt build */
2613 target->stat.time = file_max_time;
2616 * If we really built the target we read the new
2623 old_stat_time = target->stat.time;
2624 target->stat.time = file_no_time;
2625 (void) exists(target);
2626 if ((target->is_member) &&
2627 (target->stat.time == old_stat_time)) {
2628 member = get_prop(target->prop, member_prop);
2630 target->stat.time = member->body.member.library->stat.time;
2631 target->stat.time.tv_sec++;
2635 /* If the target is part of a group we need to propagate the */
2640 target_group->name->stat.time = target->stat.time;
2645 line2->body.line.target = target_group->name;
2648 target->has_built = true;
2652 * sccs_get(target, command)
2661 * target Target to get
2670 sccs_get(register Name target, register Property *command)
2682 while (target->stat.is_sym_link) {
2685 target->string_mb);
2688 result = readlink_vroot(target->string_mb,
2695 target->string_mb, errmsg(errno));
2701 Wstring wcb(target);
2708 target = normalize_name(string.buffer.start, string.text.p - string.buffer.start);
2709 (void) exists(target);
2719 if (target->stat.has_sccs == DONT_KNOW_SCCS) {
2720 read_directory_of_file(target);
2722 switch (target->stat.has_sccs) {
2725 target->stat.has_sccs = NO_SCCS;
2731 if (target->stat.time > file_doesnt_exist) {
2741 sccs_time = exists(get_prop(target->prop,
2746 if ((!target->has_complained &&
2754 * We provide a command line for the target. The line is a
2757 line = maybe_append_prop(target, line_prop);
2759 if (sccs_time > target->stat.time) {
2769 target->string_mb);
2775 if((target->prop) &&
2776 (target->prop->body.sccs.file) &&
2777 (target->prop->body.sccs.file->string_mb)) {
2778 if((strlen(target->prop->body.sccs.file->string_mb) ==
2779 strlen(target->string_mb) + 2) &&
2780 (target->prop->body.sccs.file->string_mb[0] == 's') &&
2781 (target->prop->body.sccs.file->string_mb[1] == '.')) {
2787 line->body.line.target = target;
2864 * add_pattern_conditionals(target)
2867 * that match this target to its list of conditionals.
2870 * target The target we should add conditionals for
2876 add_pattern_conditionals(register Name target)
2886 Wstring wcb(target);
2892 wcb1.init(conditional->body.conditional.target);
2901 for (previous = &target->prop;
2911 new_prop = append_prop(target, conditional_prop);
2918 target->conditional_cnt++;
2924 * set_locals(target, old_locals)
2926 * Sets any conditional macros for the target.
2927 * Each target carries a possibly empty set of conditional properties.
2930 * target The target to set conditional macros for
2939 set_locals(register Name target, register Property old_locals)
2947 if (target->dont_activate_cond_values) {
2954 for (conditional = get_prop(target->prop, conditional_prop), i = 0;
2978 /* Put this target on the front of the chain of conditional targets */
2980 cond_chain->name = target;
2987 * reset_locals(target, old_locals, conditional, index)
2989 * Removes any conditional macros for the target.
2992 * target The target we are retoring values for
2994 * conditional The first conditional block for the target
3001 reset_locals(register Name target, register Property old_locals, register Property conditional, register int index)
3006 if (target->dont_activate_cond_values) {
3014 reset_locals(target, old_locals, this_conditional, index+1);
3016 /* Remove conditional target from chain */
3018 conditional_targets->name != target) {
3019 warning(gettext("Internal error: reset target not at head of condtional_targets chain"));
3051 * check_auto_dependencies(target, auto_count, automatics)
3053 * Returns true if the target now has a dependency
3060 * target Target we check
3068 check_auto_dependencies(Name target, int auto_count, Name *automatics)
3076 if ((line = get_prop(target->prop, line_prop)) == NULL) {
3084 /* built the target */
3124 target_can_be_built(register Name target) {
3126 Name true_target = target;
3129 if (target == wait_name) {
3133 * If the target is a constructed one for a "::" target,
3136 if (target->has_target_prop) {
3137 true_target = get_prop(target->prop,
3138 target_prop)->body.target.target;
3150 /* get line property for the target */
3159 result = find_percent_rule(target, NULL, false);
3164 if (target->is_member) {
3165 Property member = get_prop(target->prop, member_prop);
3167 result = find_ar_suffix_rule(target, member->body.member.member, NULL, false);
3169 result = find_double_suffix_rule(target, NULL, false);
3172 result = find_double_suffix_rule(target, NULL, false);
3178 result = find_suffix_rule(target, target, empty_name, NULL, false);
3183 result = sccs_get(target, NULL);
3186 /* try to find dyn target */
3188 Name dtarg = find_dyntarget(target);
3194 /* check whether target was mentioned in makefile */
3196 if (target->colons != no_colon) {