Lines Matching +defs:val +defs:target
80 extern Doname doname_check(register Name target, register Boolean do_get, register Boolean implicit, register Boolean automatic);
81 extern Doname doname(register Name target, register Boolean do_get, register Boolean implicit, register Boolean automatic);
82 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);
83 void dynamic_dependencies(Name target);
90 static void do_assign(register Name line, register Name target);
91 static void build_command_strings(Name target, register Property line);
92 static Doname touch_command(register Property line, register Name target, Doname result);
94 static Doname sccs_get(register Name target, register Property *command);
96 static void add_pattern_conditionals(register Name target);
97 extern void set_locals(register Name target, register Property old_locals);
98 extern void reset_locals(register Name target, register Property old_locals, register Property conditional, register int index);
99 extern Boolean check_auto_dependencies(Name target, int auto_count, Name *automatics);
110 * doname_check(target, do_get, implicit, automatic)
118 * target The target to build
129 doname_check(register Name target, register Boolean do_get, register Boolean implicit, register Boolean automatic)
134 switch (doname(target, do_get, implicit, automatic)) {
144 target->string_mb);
153 * We later declare the target to be out of date just in
169 warning(gettext("Don't know how to make target `%s'"),
170 target->string_mb);
174 fatal(gettext("Don't know how to make target `%s'"), target->string_mb);
184 enter_explicit_rule_from_dynamic_rule(Name target, Name source)
190 line = maybe_append_prop(target, line_prop);
192 line->body.line.target = target;
200 line->body.line.less = target;
208 find_dyntarget(Name target)
216 Wstring wcb(target);
229 enter_explicit_rule_from_dynamic_rule(target, p->name);
230 return(target);
244 enter_explicit_rule_from_dynamic_rule(target, p->name);
245 return(target);
258 * doname(target, do_get, implicit)
260 * Chases all files the target depends on and builds any that
261 * are out of date. If the target is out of date it is then rebuilt.
267 * target Target to build
283 doname(register Name target, register Boolean do_get, register Boolean implicit, register Boolean automatic)
293 Name true_target = target;
304 if (target->state == build_running) {
307 line = get_prop(target->prop, line_prop);
310 * If this target is a member of target group and one of the
311 * other members of the group is running, mark this target
318 target->state = build_running;
319 add_pending(target,
329 * If the target is a constructed one for a "::" target,
332 if (target->has_target_prop) {
333 true_target = get_prop(target->prop,
334 target_prop)->body.target.target;
347 * If the target has been processed, we don't need to do it again,
351 if (target->state == build_ok) {
352 if((!keep_state || (!target->depends_on_conditional && !assign_done))) {
358 if (target->state == build_subtree) {
360 target->state = build_dont_know;
362 if (!target->checking_subtree) {
364 * This target has been started before and therefore
369 } else if (target->state == build_pending) {
370 target->state = build_dont_know;
375 (target->conditional_cnt > 0)) {
376 if (!parallel_ok(target, false)) {
377 add_subtree(target, recursion_level, do_get, implicit);
378 target->state = build_running;
384 * If KEEP_STATE is on, we have to rebuild the target if the
400 * If this target has never been built before, mark all
409 /* Save the set of automatic depes defined for this target */
442 target->string_mb);
446 if (target->state == build_in_progress) {
448 target->string_mb);
451 target->state = build_in_progress;
453 /* Activate conditional macros for the target */
454 if (!target->added_pattern_conditionals) {
455 add_pattern_conditionals(target);
456 target->added_pattern_conditionals = true;
458 if (target->conditional_cnt > 0) {
459 old_locals = (Property) alloca(target->conditional_cnt *
461 set_locals(target, old_locals);
466 * target names that are same as file name. In this case $$@ in the
470 if (!target->has_depe_list_expanded)
472 dynamic_dependencies(target);
479 if ((line = get_prop(target->prop, line_prop)) != NULL) {
483 target,
503 * If the target is a :: type, do not try to find the rule for the target,
508 * [tolik, 12 Sep 2002] Do not try to find implicit rule for the target
509 * being rechecked - the target is being rechecked means that it already
513 if (target->colon_splits == 0 && !rechecking_target) {
518 target,
525 target->state = build_running;
526 add_pending(target,
531 if (target->conditional_cnt > 0) {
532 reset_locals(target,
534 get_prop(target->prop,
548 if (target->is_member &&
549 ((member = get_prop(target->prop, member_prop)) !=
551 switch (find_ar_suffix_rule(target,
560 target->state = build_running;
561 add_pending(target,
566 if (target->conditional_cnt > 0) {
567 reset_locals(target,
569 get_prop(target->prop,
579 maybe_append_prop(target,
587 switch (find_double_suffix_rule(target,
594 target->state = build_running;
595 add_pending(target,
600 if (target->conditional_cnt > 0) {
601 reset_locals(target,
603 get_prop(target->
620 * If more than one percent rules are defined for the same target then
626 * going to say "don't know how to make target" it sets second_pass to true and
631 ((line->body.line.target != NULL) &&
632 !line->body.line.target->has_regular_dependency))) {
633 switch (find_suffix_rule(target,
634 target,
642 target->state = build_running;
643 add_pending(target,
648 if (target->conditional_cnt > 0) {
649 reset_locals(target,
651 get_prop(target->prop,
662 result = sccs_get(target, &command);
672 line = maybe_append_prop(target, line_prop);
693 line->body.line.target = true_target;
700 /* We say "target up to date" if no cmd were executed for the target */
701 if (!target->is_double_colon_parent) {
711 silent = (Boolean) target->silent_mode;
715 ignore_errors = (Boolean) target->ignore_error_mode;
730 add_running(target,
738 target->state = build_running;
739 if ((line = get_prop(target->prop,
746 if (target->conditional_cnt > 0) {
747 reset_locals(target,
749 get_prop(target->prop,
755 add_serial(target,
759 target->state = build_running;
760 line = get_prop(target->prop, line_prop);
767 if (target->conditional_cnt > 0) {
768 reset_locals(target,
770 get_prop(target->prop,
784 * If no command was found for the target, and it doesn't
785 * exist, and it is mentioned as a target in the makefile,
788 if (target->colons != no_colon) {
799 Name dtarg = find_dyntarget(target);
801 if (!target->has_depe_list_expanded) {
802 dynamic_dependencies(target);
804 if ((line = get_prop(target->prop, line_prop)) != NULL) {
808 target,
833 (void) exists(target);
834 if ((target->stat.time != file_doesnt_exist) &&
845 if ((line = get_prop(target->prop, line_prop)) != NULL) {
851 target->state = result;
853 if (target->conditional_cnt > 0) {
854 reset_locals(target,
856 get_prop(target->prop, conditional_prop),
860 if (target->is_member) {
864 if ((target->stat.time != file_max_time) &&
865 ((member = get_prop(target->prop, member_prop)) != NULL) &&
867 target->stat.time =
873 * built the target.
875 if ((result == build_ok) && check_auto_dependencies(target,
900 * target, true_target, doing_subtree, out_of_date_tail,
910 * target The target to chase dependencies for
928 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)
952 (rechecking_target || target->rechecking_target)) {
961 * The special target .WAIT means finish all of
1016 * is out of date. In this case, we just declare the target out of date
1017 * and go on. If we really need the dependency, the make'ing of the target
1039 target->depends_on_conditional = true;
1042 target->stat.time =
1151 if (target->conditional_cnt > 0) {
1152 reset_locals(target,
1154 get_prop(target->prop,
1160 target->state = build_running;
1161 add_pending(target,
1166 if (target->conditional_cnt > 0) {
1167 reset_locals(target,
1169 get_prop(target->prop,
1177 * Collect the timestamp of the youngest double colon target
1180 if (target->is_double_colon_parent) {
1188 target->stat.time =
1190 target->stat.time);
1204 warning(gettext("Too many rules defined for target %s"),
1205 target->string_mb);
1208 /* Check if the target is out of date */
1223 line->body.line.target = true_target;
1242 ((member = get_prop(target->prop, member_prop)) !=
1279 * dynamic_dependencies(target)
1283 * Here, "$@" gets translated to target->string. That is
1301 * target Target to sanitize dependencies for
1310 dynamic_dependencies(Name target)
1328 Name true_target = target;
1331 if ((line = get_prop(target->prop, line_prop)) == NULL) {
1334 /* If the target is constructed from a "::" target we consider that */
1335 if (target->has_target_prop) {
1336 true_target = get_prop(target->prop,
1337 target_prop)->body.target.target;
1346 target->has_depe_list_expanded = true;
1348 /* The make macro $@ is bound to the target name once per */
1424 (void) printf(gettext("%*sDynamic dependency `%s' for target `%s'\n"),
1459 (void) printf(gettext("%*sDynamic dependency `%s' for target `%s'\n"),
1555 * current_target Set to the target we run a command for
1573 register Name target = line->body.line.target;
1577 if (!line->body.line.is_out_of_date && target->rechecking_target) {
1578 target->rechecking_target = false;
1583 * Build the command if we know the target is out of date,
1589 build_command_strings(target, line);
1596 /* If quest, then exit(1) because the target is out of date */
1614 (target->stat.time != file_doesnt_exist) &&
1615 ((target->stat.mode & 0222) != 0)) {
1617 target->string_mb);
1618 target->has_complained = remember_only = true;
1646 int len = 2*MAXPATHLEN + strlen(target->string_mb) + 2;
1655 MBSTOWCS(to, target->string_mb);
1668 current_target = target;
1677 result = touch_command(line, target, result);
1684 * proper command(s) for the target.
1687 if (!parallel_ok(target, true)) {
1690 * this target must be built in serial.
1697 result = execute_parallel(line, true, target->localhost);
1714 result = execute_parallel(line, true, target->localhost);
1718 target->parallel = false;
1726 result = execute_parallel(line, true, target->localhost);
1741 * Runs thru the command line for the target and
1769 Name target = line->body.line.target;
1771 target->has_recursive_dependency = false;
1807 do_assign(rule->command_line, target);
1819 target);
1832 fatal(gettext("Command failed for target `%s'"),
1833 target->string_mb);
1858 Name val = spro->body.macro.value;
1859 if(val != NULL) {
1860 free_name(val);
1866 char *val = spro->body.env_mem.value;
1867 if(val != NULL) {
1872 // retmem_mb(val);
2063 * do_assign(line, target)
2069 * target The Name of the target, used for error reports
2075 do_assign(register Name line, register Name target)
2110 fatal(gettext("= expected in rule `%s' for target `%s'"),
2112 target->string_mb);
2130 * build_command_strings(target, line)
2133 * building a target. If the string is different from the previous one
2137 * target Target to build commands for
2158 build_command_strings(Name target, register Property line)
2184 /* We have to check if a target depends on conditional macros */
2186 /* since the macro values used when building the target might have */
2189 /* If we are building a lib.a(member) target $@ should be bound */
2191 if (target->is_member &&
2192 ((member = get_prop(target->prop, member_prop)) != NULL)) {
2193 target = member->body.member.library;
2195 /* If we are building a "::" help target $@ should be bound to */
2196 /* the real target name */
2197 /* A lib.a(member) target is never :: */
2198 if (target->has_target_prop) {
2199 target = get_prop(target->prop, target_prop)->
2200 body.target.target;
2203 tmp_name = target;
2407 target->string_mb,
2418 target->string_mb,
2443 target->string_mb);
2458 target->string_mb);
2478 target->conditional_macro_list = cond_macro_list;
2480 target->depends_on_conditional = true;
2485 * touch_command(line, target, result)
2488 * We touch all targets in the target group ("foo + fie:") if any.
2495 * target The target we are touching
2503 touch_command(register Property line, register Name target, Doname result)
2512 for (name = target, target_group = NULL; name != NULL;) {
2573 * updates the status of a target after executing its commands.
2586 Name target;
2595 * target is a symlink and sccs file is newer then target.
2604 target = line->body.line.target;
2609 (target->is_member &&
2614 /* new timestamp for the target we didnt build */
2615 target->stat.time = file_max_time;
2618 * If we really built the target we read the new
2625 old_stat_time = target->stat.time;
2626 target->stat.time = file_no_time;
2627 (void) exists(target);
2628 if ((target->is_member) &&
2629 (target->stat.time == old_stat_time)) {
2630 member = get_prop(target->prop, member_prop);
2632 target->stat.time = member->body.member.library->stat.time;
2633 target->stat.time.tv_sec++;
2637 /* If the target is part of a group we need to propagate the */
2642 target_group->name->stat.time = target->stat.time;
2647 line2->body.line.target = target_group->name;
2650 target->has_built = true;
2654 * sccs_get(target, command)
2663 * target Target to get
2672 sccs_get(register Name target, register Property *command)
2684 while (target->stat.is_sym_link) {
2687 target->string_mb);
2690 result = readlink_vroot(target->string_mb,
2697 target->string_mb, errmsg(errno));
2703 Wstring wcb(target);
2710 target = normalize_name(string.buffer.start, string.text.p - string.buffer.start);
2711 (void) exists(target);
2721 if (target->stat.has_sccs == DONT_KNOW_SCCS) {
2722 read_directory_of_file(target);
2724 switch (target->stat.has_sccs) {
2727 target->stat.has_sccs = NO_SCCS;
2733 if (target->stat.time > file_doesnt_exist) {
2743 sccs_time = exists(get_prop(target->prop,
2748 if ((!target->has_complained &&
2756 * We provide a command line for the target. The line is a
2759 line = maybe_append_prop(target, line_prop);
2761 if (sccs_time > target->stat.time) {
2771 target->string_mb);
2777 if((target->prop) &&
2778 (target->prop->body.sccs.file) &&
2779 (target->prop->body.sccs.file->string_mb)) {
2780 if((strlen(target->prop->body.sccs.file->string_mb) ==
2781 strlen(target->string_mb) + 2) &&
2782 (target->prop->body.sccs.file->string_mb[0] == 's') &&
2783 (target->prop->body.sccs.file->string_mb[1] == '.')) {
2789 line->body.line.target = target;
2866 * add_pattern_conditionals(target)
2869 * that match this target to its list of conditionals.
2872 * target The target we should add conditionals for
2878 add_pattern_conditionals(register Name target)
2888 Wstring wcb(target);
2894 wcb1.init(conditional->body.conditional.target);
2907 for (previous = &target->prop;
2917 new_prop = append_prop(target, conditional_prop);
2924 target->conditional_cnt++;
2930 * set_locals(target, old_locals)
2932 * Sets any conditional macros for the target.
2933 * Each target carries a possibly empty set of conditional properties.
2936 * target The target to set conditional macros for
2945 set_locals(register Name target, register Property old_locals)
2953 if (target->dont_activate_cond_values) {
2960 for (conditional = get_prop(target->prop, conditional_prop), i = 0;
2984 /* Put this target on the front of the chain of conditional targets */
2986 cond_chain->name = target;
2993 * reset_locals(target, old_locals, conditional, index)
2995 * Removes any conditional macros for the target.
2998 * target The target we are retoring values for
3000 * conditional The first conditional block for the target
3007 reset_locals(register Name target, register Property old_locals, register Property conditional, register int index)
3012 if (target->dont_activate_cond_values) {
3020 reset_locals(target, old_locals, this_conditional, index+1);
3022 /* Remove conditional target from chain */
3024 conditional_targets->name != target) {
3025 warning(gettext("Internal error: reset target not at head of condtional_targets chain"));
3057 * check_auto_dependencies(target, auto_count, automatics)
3059 * Returns true if the target now has a dependency
3066 * target Target we check
3074 check_auto_dependencies(Name target, int auto_count, Name *automatics)
3082 if ((line = get_prop(target->prop, line_prop)) == NULL) {
3090 /* built the target */
3130 target_can_be_built(register Name target) {
3132 Name true_target = target;
3135 if (target == wait_name) {
3139 * If the target is a constructed one for a "::" target,
3142 if (target->has_target_prop) {
3143 true_target = get_prop(target->prop,
3144 target_prop)->body.target.target;
3156 /* get line property for the target */
3165 result = find_percent_rule(target, NULL, false);
3170 if (target->is_member) {
3171 Property member = get_prop(target->prop, member_prop);
3173 result = find_ar_suffix_rule(target, member->body.member.member, NULL, false);
3175 result = find_double_suffix_rule(target, NULL, false);
3178 result = find_double_suffix_rule(target, NULL, false);
3184 result = find_suffix_rule(target, target, empty_name, NULL, false);
3189 result = sccs_get(target, NULL);
3192 /* try to find dyn target */
3194 Name dtarg = find_dyntarget(target);
3200 /* check whether target was mentioned in makefile */
3202 if (target->colons != no_colon) {