Changeset 922 for trunk/src/gmakenew/read.c
- Timestamp:
- May 25, 2007, 6:44:01 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gmakenew/read.c
r921 r922 2062 2062 the operator is only required to switch between maybe and non-maybe 2063 2063 mode: 2064 `primary + 2nd 3rd +| 4th-maybe + 5th-for-sure: deps; cmds' */ 2064 `primary + 2nd 3rd +| 4th-maybe + 5th-for-sure: deps; cmds' 2065 2066 The whole idea of the maybe-updated files is this: 2067 timestamp +| maybe.h: src1.c src2.c 2068 grep goes-into-maybe.h $* > timestamp 2069 cmp timestamp maybe.h || cp -f timestamp maybe.h 2070 2071 This is handled below by adding replacing the prereqs of the 2072 maybe-updated by an order only dependency on the primary target 2073 (see below). This saves messing up remake.c. */ 2065 2074 if (multi_mode != m_no && name[0] == '+' 2066 2075 && (name[1] == '\0' || (name[1] == '|' && name[2] == '\0'))) … … 2133 2142 f->cmds = cmds; 2134 2143 2144 #ifdef CONFIG_WITH_EXPLICIT_MULTITARGET 2145 /* If this is an explicit multi target rule, add it to the 2146 target chain and set the multi_maybe flag according to 2147 the current mode. This is also where we do the dependency 2148 tricks for the 'maybe' targets (see above). */ 2149 2150 if (multi_mode >= m_yes) 2151 { 2152 f->multi_maybe = multi_mode == m_yes_maybe; 2153 if (f->multi_maybe) 2154 { 2155 /* expand_deps needs the "| " bit. 2156 XXX leaking memory here? */ 2157 size_t len = strlen (prev_file->multi_head->name) + 1; 2158 char *maybe_dep = xmalloc (len + 2); 2159 memcpy (maybe_dep, "| ", 2); 2160 memcpy (maybe_dep + 2, prev_file->multi_head->name, len); 2161 2162 free_dep_chain (this); 2163 this = alloc_dep (); 2164 this->name = maybe_dep; 2165 this->ignore_mtime = 1; 2166 } 2167 prev_file->multi_next = f; 2168 assert (prev_file->multi_head != 0); 2169 f->multi_head = prev_file->multi_head; 2170 2171 if (f == suffix_file) 2172 error (flocp, 2173 _(".SUFFIXES encountered in an explicit multi target rule")); 2174 } 2175 prev_file = f; 2176 #endif 2177 2135 2178 /* Defining .SUFFIXES with no dependencies clears out the list of 2136 2179 suffixes. */ … … 2194 2237 f->updating = 1; 2195 2238 } 2196 2197 #ifdef CONFIG_WITH_EXPLICIT_MULTITARGET2198 /* If this is an explicit multi target rule, add it to the2199 target chain and set the multi_maybe flag according to2200 the current mode. */2201 2202 if (multi_mode >= m_yes)2203 {2204 f->multi_maybe = multi_mode == m_yes_maybe;2205 prev_file->multi_next = f;2206 assert (prev_file->multi_head != 0);2207 f->multi_head = prev_file->multi_head;2208 }2209 prev_file = f;2210 #endif2211 2239 } 2212 2240 else
Note:
See TracChangeset
for help on using the changeset viewer.