Changeset 3138 in kBuild for vendor/gnumake/current/filedef.h
- Timestamp:
- Mar 12, 2018 7:32:29 PM (7 years ago)
- File:
-
- 1 edited
-
vendor/gnumake/current/filedef.h (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
vendor/gnumake/current/filedef.h
r2596 r3138 1 1 /* Definition of target file data structures for GNU Make. 2 Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 3 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 4 2010 Free Software Foundation, Inc. 2 Copyright (C) 1988-2016 Free Software Foundation, Inc. 5 3 This file is part of GNU Make. 6 4 … … 20 18 /* Structure that represents the info on one file 21 19 that the makefile says how to make. 22 All of these are chained together through `next'. */20 All of these are chained together through 'next'. */ 23 21 24 22 #include "hash.h" … … 29 27 const char *hname; /* Hashed filename */ 30 28 const char *vpath; /* VPATH/vpath pathname */ 31 struct dep *deps; /* all dependencies, including duplicates */ 32 struct commands *cmds; /* Commands to execute for this target. */ 33 int command_flags; /* Flags OR'd in for cmds; see commands.h. */ 34 const char *stem; /* Implicit stem, if an implicit 29 struct dep *deps; /* all dependencies, including duplicates */ 30 struct commands *cmds; /* Commands to execute for this target. */ 31 const char *stem; /* Implicit stem, if an implicit 35 32 rule has been used */ 36 struct dep *also_make; /* Targets that are made by making this. */ 37 FILE_TIMESTAMP last_mtime; /* File's modtime, if already known. */ 38 FILE_TIMESTAMP mtime_before_update; /* File's modtime before any updating 39 has been performed. */ 40 struct file *prev; /* Previous entry for same file name; 41 used when there are multiple double-colon 42 entries for the same file. */ 33 struct dep *also_make; /* Targets that are made by making this. */ 34 struct file *prev; /* Previous entry for same file name; 35 used when there are multiple double-colon 36 entries for the same file. */ 43 37 struct file *last; /* Last entry for the same file name. */ 44 38 45 39 /* File that this file was renamed to. After any time that a 46 file could be renamed, call `check_renamed' (below). */40 file could be renamed, call 'check_renamed' (below). */ 47 41 struct file *renamed; 48 42 … … 62 56 struct file *double_colon; 63 57 64 short int update_status; /* Status of the last attempt to update, 65 or -1 if none has been made. */ 66 67 enum cmd_state /* State of the commands. */ 68 { /* Note: It is important that cs_not_started be zero. */ 69 cs_not_started, /* Not yet started. */ 70 cs_deps_running, /* Dep commands running. */ 71 cs_running, /* Commands running. */ 72 cs_finished /* Commands finished. */ 58 FILE_TIMESTAMP last_mtime; /* File's modtime, if already known. */ 59 FILE_TIMESTAMP mtime_before_update; /* File's modtime before any updating 60 has been performed. */ 61 unsigned int considered; /* equal to 'considered' if file has been 62 considered on current scan of goal chain */ 63 int command_flags; /* Flags OR'd in for cmds; see commands.h. */ 64 enum update_status /* Status of the last attempt to update. */ 65 { 66 us_success = 0, /* Successfully updated. Must be 0! */ 67 us_none, /* No attempt to update has been made. */ 68 us_question, /* Needs to be updated (-q is is set). */ 69 us_failed /* Update failed. */ 70 } update_status ENUM_BITFIELD (2); 71 enum cmd_state /* State of the commands. */ 72 { 73 cs_not_started = 0, /* Not yet started. Must be 0! */ 74 cs_deps_running, /* Dep commands running. */ 75 cs_running, /* Commands running. */ 76 cs_finished /* Commands finished. */ 73 77 } command_state ENUM_BITFIELD (2); 74 78 75 unsigned int precious:1; /* Non-0 means don't delete file on quit */ 76 unsigned int low_resolution_time:1; /* Nonzero if this file's time stamp 77 has only one-second resolution. */ 79 unsigned int builtin:1; /* True if the file is a builtin rule. */ 80 unsigned int precious:1; /* Non-0 means don't delete file on quit */ 81 unsigned int loaded:1; /* True if the file is a loaded object. */ 82 unsigned int low_resolution_time:1; /* Nonzero if this file's time stamp 83 has only one-second resolution. */ 78 84 unsigned int tried_implicit:1; /* Nonzero if have searched 79 for implicit rule for making80 this file; don't search again. */81 unsigned int updating:1; /* Nonzero while updating deps of this file */82 unsigned int updated:1; /* Nonzero if this file has been remade. */83 unsigned int is_target:1; /* Nonzero if file is described as target. */84 unsigned int cmd_target:1; /* Nonzero if file was given on cmd line. */85 unsigned int phony:1; /* Nonzero if this is a phony file86 i.e., a prerequisite of .PHONY. */85 for implicit rule for making 86 this file; don't search again. */ 87 unsigned int updating:1; /* Nonzero while updating deps of this file */ 88 unsigned int updated:1; /* Nonzero if this file has been remade. */ 89 unsigned int is_target:1; /* Nonzero if file is described as target. */ 90 unsigned int cmd_target:1; /* Nonzero if file was given on cmd line. */ 91 unsigned int phony:1; /* Nonzero if this is a phony file 92 i.e., a prerequisite of .PHONY. */ 87 93 unsigned int intermediate:1;/* Nonzero if this is an intermediate file. */ 88 94 unsigned int secondary:1; /* Nonzero means remove_intermediates should 89 95 not delete it. */ 90 unsigned int dontcare:1; /* Nonzero if no complaint is to be made if91 this target cannot be remade. */96 unsigned int dontcare:1; /* Nonzero if no complaint is to be made if 97 this target cannot be remade. */ 92 98 unsigned int ignore_vpath:1;/* Nonzero if we threw out VPATH name. */ 93 99 unsigned int pat_searched:1;/* Nonzero if we already searched for 94 100 pattern-specific variables. */ 95 unsigned int considered:1; /* equal to 'considered' if file has been96 considered on current scan of goal chain */97 101 unsigned int no_diag:1; /* True if the file failed to update and no 98 102 diagnostics has been issued (dontcare). */ … … 100 104 101 105 102 extern struct file * suffix_file, *default_file;106 extern struct file *default_file; 103 107 104 108 … … 114 118 void notice_finished_file (struct file *file); 115 119 void init_hash_files (void); 120 void verify_file_data_base (void); 116 121 char *build_target_list (char *old_list); 117 122 void print_prereqs (const struct dep *deps); 118 123 void print_file_data_base (void); 124 int try_implicit_rule (struct file *file, unsigned int depth); 125 int stemlen_compare (const void *v1, const void *v2); 119 126 120 127 #if FILE_TIMESTAMP_HI_RES 121 128 # define FILE_TIMESTAMP_STAT_MODTIME(fname, st) \ 122 file_timestamp_cons (fname, (st).st_mtime, (st). st_mtim.ST_MTIM_NSEC)129 file_timestamp_cons (fname, (st).st_mtime, (st).ST_MTIM_NSEC) 123 130 #else 124 131 # define FILE_TIMESTAMP_STAT_MODTIME(fname, st) \ … … 135 142 136 143 #define FILE_TIMESTAMP_S(ts) (((ts) - ORDINARY_MTIME_MIN) \ 137 >> FILE_TIMESTAMP_LO_BITS)144 >> FILE_TIMESTAMP_LO_BITS) 138 145 #define FILE_TIMESTAMP_NS(ts) ((int) (((ts) - ORDINARY_MTIME_MIN) \ 139 & ((1 << FILE_TIMESTAMP_LO_BITS) - 1)))146 & ((1 << FILE_TIMESTAMP_LO_BITS) - 1))) 140 147 141 148 /* Upper bound on length of string "YYYY-MM-DD HH:MM:SS.NNNNNNNNN" 142 representing a file timestamp. The upper bound is not necessarily 19,149 representing a file timestamp. The upper bound is not necessarily 29, 143 150 since the year might be less than -999 or greater than 9999. 144 151 … … 157 164 + 1 + 1 + 4 + 25) 158 165 159 FILE_TIMESTAMP file_timestamp_cons (char const *, time_t, int);166 FILE_TIMESTAMP file_timestamp_cons (char const *, time_t, long int); 160 167 FILE_TIMESTAMP file_timestamp_now (int *); 161 168 void file_timestamp_sprintf (char *p, FILE_TIMESTAMP ts); … … 188 195 #define ORDINARY_MTIME_MIN (OLD_MTIME + 1) 189 196 #define ORDINARY_MTIME_MAX ((FILE_TIMESTAMP_S (NEW_MTIME) \ 190 << FILE_TIMESTAMP_LO_BITS) \191 + ORDINARY_MTIME_MIN + FILE_TIMESTAMPS_PER_S - 1)192 193 /* Modtime value to use for `infinitely new'. We used to get the current time194 from the system and use that whenever we wanted `new'. But that causes197 << FILE_TIMESTAMP_LO_BITS) \ 198 + ORDINARY_MTIME_MIN + FILE_TIMESTAMPS_PER_S - 1) 199 200 /* Modtime value to use for 'infinitely new'. We used to get the current time 201 from the system and use that whenever we wanted 'new'. But that causes 195 202 trouble when the machine running make and the machine holding a file have 196 different ideas about what time it is; and can also lose for `force'203 different ideas about what time it is; and can also lose for 'force' 197 204 targets, which need to be considered newer than anything that depends on 198 205 them, even if said dependents' modtimes are in the future. */
Note:
See TracChangeset
for help on using the changeset viewer.

