• Home
  • Raw
  • Download

Lines Matching refs:file

42 extern int try_implicit_rule PARAMS ((struct file *file, unsigned int depth));
63 static int update_file PARAMS ((struct file *file, unsigned int depth));
64 static int update_file_1 PARAMS ((struct file *file, unsigned int depth));
65 static int check_dep PARAMS ((struct file *file, unsigned int depth, FILE_TIMESTAMP this_mtime, int…
66 static int touch_file PARAMS ((struct file *file));
67 static void remake_file PARAMS ((struct file *file));
87 #define MTIME(file) (rebuilding_makefiles ? file_mtime_no_search (file) \ in update_goal_chain() argument
88 : file_mtime (file)) in update_goal_chain()
127 struct file *file; in update_goal_chain() local
130 for (file = g->file->double_colon ? g->file->double_colon : g->file; in update_goal_chain()
131 file != NULL; in update_goal_chain()
132 file = file->prev) in update_goal_chain()
136 check_renamed (file); in update_goal_chain()
139 if (file->cmd_target) in update_goal_chain()
154 x = update_file (file, rebuilding_makefiles ? 1 : 0); in update_goal_chain()
155 check_renamed (file); in update_goal_chain()
168 if ((x != 0 || file->updated) && status < 1) in update_goal_chain()
170 if (file->update_status != 0) in update_goal_chain()
174 status = file->update_status; in update_goal_chain()
183 FILE_TIMESTAMP mtime = MTIME (file); in update_goal_chain()
184 check_renamed (file); in update_goal_chain()
186 if (file->updated && g->changed && in update_goal_chain()
187 mtime != file->mtime_before_update) in update_goal_chain()
198 if (rebuilding_makefiles && file->dontcare) in update_goal_chain()
207 any_not_updated |= !file->updated; in update_goal_chain()
214 file = g->file; in update_goal_chain()
225 && file->update_status == 0 && !g->changed in update_goal_chain()
228 message (1, ((file->phony || file->cmds == 0) in update_goal_chain()
231 file->name); in update_goal_chain()
284 update_file (struct file *file, unsigned int depth) in update_file() argument
287 register struct file *f; in update_file()
289 f = file->double_colon ? file->double_colon : file; in update_file()
329 if (file->double_colon) in update_file()
337 status |= update_file (d->file, depth + 1); in update_file()
346 complain (const struct file *file) in complain() argument
355 if (file->parent == 0) in complain()
356 fatal (NILF, msg_noparent, "", file->name, ""); in complain()
358 fatal (NILF, msg_parent, "", file->name, file->parent->name, ""); in complain()
361 if (file->parent == 0) in complain()
362 error (NILF, msg_noparent, "*** ", file->name, "."); in complain()
364 error (NILF, msg_parent, "*** ", file->name, file->parent->name, "."); in complain()
370 update_file_1 (struct file *file, unsigned int depth) in update_file_1() argument
380 if (file->updated) in update_file_1()
382 if (file->update_status > 0) in update_file_1()
391 if (file->dontcare && !rebuilding_makefiles) in update_file_1()
393 file->dontcare = 0; in update_file_1()
394 complain (file); in update_file_1()
397 return file->update_status; in update_file_1()
404 switch (file->command_state) in update_file_1()
414 return file->update_status; in update_file_1()
422 start_updating (file); in update_file_1()
430 this_mtime = file_mtime (file); in update_file_1()
431 check_renamed (file); in update_file_1()
436 && file->low_resolution_time) in update_file_1()
442 file->name); in update_file_1()
451 if (!file->phony && file->cmds == 0 && !file->tried_implicit) in update_file_1()
453 if (try_implicit_rule (file, depth)) in update_file_1()
457 file->tried_implicit = 1; in update_file_1()
459 if (file->cmds == 0 && !file->is_target in update_file_1()
463 file->cmds = default_file->cmds; in update_file_1()
470 d = file->deps; in update_file_1()
477 check_renamed (d->file); in update_file_1()
479 mtime = file_mtime (d->file); in update_file_1()
480 check_renamed (d->file); in update_file_1()
482 if (is_updating (d->file)) in update_file_1()
485 file->name, d->file->name); in update_file_1()
490 file->deps = d->next; in update_file_1()
497 d->file->parent = file; in update_file_1()
503 dontcare = d->file->dontcare; in update_file_1()
504 d->file->dontcare = file->dontcare; in update_file_1()
508 dep_status |= check_dep (d->file, depth, this_mtime, &maybe_make); in update_file_1()
512 d->file->dontcare = dontcare; in update_file_1()
517 check_renamed (d->file); in update_file_1()
520 register struct file *f = d->file; in update_file_1()
540 d->changed = ((file_mtime (d->file) != mtime) in update_file_1()
552 for (d = file->deps; d != 0; d = d->next) in update_file_1()
553 if (d->file->intermediate) in update_file_1()
557 FILE_TIMESTAMP mtime = file_mtime (d->file); in update_file_1()
558 check_renamed (d->file); in update_file_1()
559 d->file->parent = file; in update_file_1()
564 dontcare = d->file->dontcare; in update_file_1()
565 d->file->dontcare = file->dontcare; in update_file_1()
569 dep_status |= update_file (d->file, depth); in update_file_1()
573 d->file->dontcare = dontcare; in update_file_1()
575 check_renamed (d->file); in update_file_1()
578 register struct file *f = d->file; in update_file_1()
594 d->changed = ((file->phony && file->cmds != 0) in update_file_1()
595 || file_mtime (d->file) != mtime); in update_file_1()
599 finish_updating (file); in update_file_1()
605 set_command_state (file, cs_deps_running); in update_file_1()
615 file->update_status = dep_status; in update_file_1()
616 notice_finished_file (file); in update_file_1()
625 _("Target `%s' not remade because of errors."), file->name); in update_file_1()
630 if (file->command_state == cs_deps_running) in update_file_1()
639 set_command_state (file, cs_not_started); in update_file_1()
645 for (d = file->deps; d != 0; d = d->next) in update_file_1()
647 FILE_TIMESTAMP d_mtime = file_mtime (d->file); in update_file_1()
648 check_renamed (d->file); in update_file_1()
656 if (d_mtime == NONEXISTENT_MTIME && !d->file->intermediate) in update_file_1()
695 printf (fmt, dep_name (d), file->name); in update_file_1()
704 if (file->double_colon && file->deps == 0) in update_file_1()
710 else if (!noexist && file->is_target && !deps_changed && file->cmds == 0 in update_file_1()
717 else if (!must_make && file->cmds != 0 && always_make_flag) in update_file_1()
728 printf (_("No need to remake target `%s'"), file->name); in update_file_1()
729 if (!streq (file->name, file->hname)) in update_file_1()
730 printf (_("; using VPATH name `%s'"), file->hname); in update_file_1()
735 notice_finished_file (file); in update_file_1()
741 while (file) in update_file_1()
743 file->name = file->hname; in update_file_1()
744 file = file->prev; in update_file_1()
754 if (!streq(file->name, file->hname)) in update_file_1()
756 DB (DB_BASIC, (_(" Ignoring VPATH name `%s'.\n"), file->hname)); in update_file_1()
757 file->ignore_vpath = 1; in update_file_1()
761 remake_file (file); in update_file_1()
763 if (file->command_state != cs_finished) in update_file_1()
769 switch (file->update_status) in update_file_1()
781 assert (file->update_status >= 0 && file->update_status <= 2); in update_file_1()
785 file->updated = 1; in update_file_1()
786 return file->update_status; in update_file_1()
796 notice_finished_file (struct file *file) in notice_finished_file() argument
799 int ran = file->command_state == cs_running; in notice_finished_file()
802 file->command_state = cs_finished; in notice_finished_file()
803 file->updated = 1; in notice_finished_file()
812 && file->update_status == 0) in notice_finished_file()
814 if (file->cmds != 0 && file->cmds->any_recurse) in notice_finished_file()
819 for (i = 0; i < file->cmds->ncommand_lines; ++i) in notice_finished_file()
820 if (!(file->cmds->lines_flags[i] & COMMANDS_RECURSE)) in notice_finished_file()
826 if (file->phony) in notice_finished_file()
827 file->update_status = 0; in notice_finished_file()
829 else if (file->cmds != 0) in notice_finished_file()
832 file->update_status = touch_file (file); in notice_finished_file()
847 if (file->mtime_before_update == UNKNOWN_MTIME) in notice_finished_file()
848 file->mtime_before_update = file->last_mtime; in notice_finished_file()
850 if ((ran && !file->phony) || touched) in notice_finished_file()
860 for (i = file->cmds->ncommand_lines; i > 0; --i) in notice_finished_file()
861 if (! (file->cmds->lines_flags[i-1] & COMMANDS_RECURSE)) in notice_finished_file()
867 else if (file->is_target && file->cmds == 0) in notice_finished_file()
870 file->last_mtime = i == 0 ? UNKNOWN_MTIME : NEW_MTIME; in notice_finished_file()
873 if (file->double_colon) in notice_finished_file()
885 struct file *f; in notice_finished_file()
886 FILE_TIMESTAMP max_mtime = file->last_mtime; in notice_finished_file()
891 for (f = file->double_colon; f != 0 && f->updated; f = f->prev) in notice_finished_file()
897 for (f = file->double_colon; f != 0; f = f->prev) in notice_finished_file()
901 if (ran && file->update_status != -1) in notice_finished_file()
906 for (d = file->also_make; d != 0; d = d->next) in notice_finished_file()
908 d->file->command_state = cs_finished; in notice_finished_file()
909 d->file->updated = 1; in notice_finished_file()
910 d->file->update_status = file->update_status; in notice_finished_file()
912 if (ran && !d->file->phony) in notice_finished_file()
917 (void) f_mtime (d->file, 0); in notice_finished_file()
919 else if (file->update_status == -1) in notice_finished_file()
922 file->update_status = 0; in notice_finished_file()
933 check_dep (struct file *file, unsigned int depth, in check_dep() argument
940 start_updating (file); in check_dep()
942 if (file->phony || !file->intermediate) in check_dep()
947 dep_status = update_file (file, depth); in check_dep()
948 check_renamed (file); in check_dep()
949 mtime = file_mtime (file); in check_dep()
950 check_renamed (file); in check_dep()
959 if (!file->phony && file->cmds == 0 && !file->tried_implicit) in check_dep()
961 if (try_implicit_rule (file, depth)) in check_dep()
965 file->tried_implicit = 1; in check_dep()
967 if (file->cmds == 0 && !file->is_target in check_dep()
971 file->cmds = default_file->cmds; in check_dep()
976 check_renamed (file); in check_dep()
977 mtime = file_mtime (file); in check_dep()
978 check_renamed (file); in check_dep()
989 d = file->deps; in check_dep()
994 if (is_updating (d->file)) in check_dep()
997 file->name, d->file->name); in check_dep()
1000 file->deps = d->next; in check_dep()
1002 d = file->deps; in check_dep()
1013 d->file->parent = file; in check_dep()
1015 dep_status |= check_dep (d->file, depth, this_mtime, in check_dep()
1019 check_renamed (d->file); in check_dep()
1023 if (d->file->command_state == cs_running in check_dep()
1024 || d->file->command_state == cs_deps_running) in check_dep()
1028 set_command_state (file, cs_deps_running); in check_dep()
1036 finish_updating (file); in check_dep()
1042 #define TOUCH_ERROR(call) return (perror_with_name (call, file->name), 1)
1045 touch_file (struct file *file) in touch_file() argument
1048 message (0, "touch %s", file->name); in touch_file()
1051 if (ar_name (file->name)) in touch_file()
1052 return ar_touch (file->name); in touch_file()
1056 int fd = open (file->name, O_RDWR | O_CREAT, 0666); in touch_file()
1081 fd = open (file->name, O_RDWR | O_TRUNC, 0666); in touch_file()
1097 remake_file (struct file *file) in remake_file() argument
1099 if (file->cmds == 0) in remake_file()
1101 if (file->phony) in remake_file()
1103 file->update_status = 0; in remake_file()
1104 else if (file->is_target) in remake_file()
1107 file->update_status = 0; in remake_file()
1111 if (!rebuilding_makefiles || !file->dontcare) in remake_file()
1112 complain (file); in remake_file()
1113 file->update_status = 2; in remake_file()
1118 chop_commands (file->cmds); in remake_file()
1121 if (!touch_flag || file->cmds->any_recurse) in remake_file()
1123 execute_file_commands (file); in remake_file()
1128 file->update_status = 0; in remake_file()
1132 notice_finished_file (file); in remake_file()
1144 f_mtime (struct file *file, int search) in f_mtime() argument
1151 if (ar_name (file->name)) in f_mtime()
1156 struct file *arfile; in f_mtime()
1161 ar_parse_name (file->name, &arname, &memname); in f_mtime()
1203 rename_file (file, name); in f_mtime()
1205 rehash_file (file, name); in f_mtime()
1206 check_renamed (file); in f_mtime()
1213 file->low_resolution_time = 1; in f_mtime()
1219 member_date = ar_member_date (file->hname); in f_mtime()
1222 : file_timestamp_cons (file->hname, member_date, 0)); in f_mtime()
1227 mtime = name_mtime (file->name); in f_mtime()
1229 if (mtime == NONEXISTENT_MTIME && search && !file->ignore_vpath) in f_mtime()
1232 char *name = file->name; in f_mtime()
1241 file->last_mtime = mtime; in f_mtime()
1246 if (gpath_search (name, strlen(name) - strlen(file->name) - 1)) in f_mtime()
1248 rename_file (file, name); in f_mtime()
1249 check_renamed (file); in f_mtime()
1250 return file_mtime (file); in f_mtime()
1253 rehash_file (file, name); in f_mtime()
1254 check_renamed (file); in f_mtime()
1271 && !file->updated) in f_mtime()
1307 file->name); in f_mtime()
1314 file->name, from_now); in f_mtime()
1322 if (file->double_colon) in f_mtime()
1323 file = file->double_colon; in f_mtime()
1332 if (mtime != NONEXISTENT_MTIME && file->command_state == cs_not_started in f_mtime()
1333 && file->command_state == cs_not_started in f_mtime()
1334 && !file->tried_implicit && file->intermediate) in f_mtime()
1335 file->intermediate = 0; in f_mtime()
1337 file->last_mtime = mtime; in f_mtime()
1338 file = file->prev; in f_mtime()
1340 while (file != 0); in f_mtime()
1478 char *file, **dp; in library_search() local
1535 file = libbuf; in library_search()
1536 if (vpath_search (&file, mtime_ptr)) in library_search()
1538 *lib = file; in library_search()