Changeset 1021 for trunk/src/kmk/read.c
- Timestamp:
- Jun 4, 2007, 2:58:37 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/read.c
r940 r1021 2044 2044 { 2045 2045 max_targets += 5; 2046 targets = xrealloc ( targets, max_targets * sizeof (char *));2047 target_percents = xrealloc ( target_percents,2046 targets = xrealloc ((void *)targets, max_targets * sizeof (char *)); 2047 target_percents = xrealloc ((void *)target_percents, 2048 2048 max_targets * sizeof (char *)); 2049 2049 } … … 2056 2056 #ifdef CONFIG_WITH_EXPLICIT_MULTITARGET 2057 2057 /* Check for the explicit multitarget mode operators. For this to be 2058 identified as an ex cplicit multiple target rule, the first + or +|2058 identified as an explicit multiple target rule, the first + or +| 2059 2059 operator *must* appear between the first two files. If not found as 2060 2060 the 2nd file or if found as the 1st file, the rule will be rejected … … 2069 2069 cmp timestamp maybe.h || cp -f timestamp maybe.h 2070 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. */ 2071 This is implemented in remake.c where we don't consider the mtime of 2072 the maybe-updated targets. */ 2074 2073 if (multi_mode != m_no && name[0] == '+' 2075 2074 && (name[1] == '\0' || (name[1] == '|' && name[2] == '\0'))) … … 2080 2079 { 2081 2080 if (multi_mode == m_unsettled) 2082 prev_file->multi_head = prev_file; 2081 { 2082 prev_file->multi_head = prev_file; 2083 2084 /* Only the primary file needs the dependencies. */ 2085 if (deps) 2086 { 2087 free_dep_chain (deps); 2088 deps = NULL; 2089 } 2090 } 2083 2091 multi_mode = name[1] == '\0' ? m_yes : m_yes_maybe; 2084 2092 continue; … … 2141 2149 if (cmds != 0) 2142 2150 f->cmds = cmds; 2143 2144 #ifdef CONFIG_WITH_EXPLICIT_MULTITARGET2145 /* If this is an explicit multi target rule, add it to the2146 target chain and set the multi_maybe flag according to2147 the current mode. This is also where we do the dependency2148 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 #endif2177 2151 2178 2152 /* Defining .SUFFIXES with no dependencies clears out the list of
Note:
See TracChangeset
for help on using the changeset viewer.