Changeset 3278 in kBuild for trunk/src/kmk/kbuild.c
- Timestamp:
- Jan 4, 2019 5:08:23 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/kbuild.c
r3251 r3278 2007 2007 #endif 2008 2008 struct variable *pObj = kbuild_set_object_name_and_dep_and_dirdep_and_PATH_target_source(pTarget, pSource, pOutBase, pObjSuff, "obj", &pDep, &pDirDep); 2009 int fInstallOld Vars= 0;2009 int fInstallOldObjsVar = 0; 2010 2010 char *pszDstVar, *pszDst, *pszSrcVar, *pszSrc, *pszVal, *psz; 2011 2011 char *pszSavedVarBuf; … … 2123 2123 /** @todo Make all these local variables, if someone needs the info later it 2124 2124 * can be recalculated. (Ticket #80.) */ 2125 cch = sizeof("TOOL_") + pTool->value_length + sizeof("_COMPILE_") + pType->value_length + sizeof("_ OUTPUT_MAYBE");2125 cch = sizeof("TOOL_") + pTool->value_length + sizeof("_COMPILE_") + pType->value_length + sizeof("_USES_KOBJCACHE"); 2126 2126 if (cch < pTarget->value_length + sizeof("$(_2_OBJS)")) 2127 2127 cch = pTarget->value_length + sizeof("$(_2_OBJS)"); … … 2143 2143 memcpy(pszDst, "_CMDS_", sizeof("_CMDS_")); 2144 2144 pVar = kbuild_get_recursive_variable(pszSrcVar); 2145 do_variable_definition_2(NILF, pszDstVar, pVar->value, pVar->value_length, 2146 !pVar->recursive, 0, o_local, f_simple, 0 /* !target_var */); 2145 if (iVer <= 2) 2146 do_variable_definition_2(NILF, pszDstVar, pVar->value, pVar->value_length, 2147 !pVar->recursive, 0, o_local, f_simple, 0 /* !target_var */); 2147 2148 do_variable_definition_2(NILF, "kbsrc_cmds", pVar->value, pVar->value_length, 2148 2149 !pVar->recursive, 0, o_local, f_simple, 0 /* !target_var */); … … 2151 2152 memcpy(pszDst, "_OUTPUT_", sizeof("_OUTPUT_")); 2152 2153 pVar = kbuild_get_recursive_variable(pszSrcVar); 2153 pOutput = do_variable_definition_2(NILF, pszDstVar, pVar->value, pVar->value_length, 2154 !pVar->recursive, 0, o_local, f_simple, 0 /* !target_var */); 2154 if (iVer <= 2) 2155 pOutput = do_variable_definition_2(NILF, pszDstVar, pVar->value, pVar->value_length, 2156 !pVar->recursive, 0, o_local, f_simple, 0 /* !target_var */); 2155 2157 pOutput = do_variable_definition_2(NILF, "kbsrc_output", pVar->value, pVar->value_length, 2156 2158 !pVar->recursive, 0, o_local, f_simple, 0 /* !target_var */); … … 2161 2163 if (pVar) 2162 2164 { 2163 pOutputMaybe = do_variable_definition_2(NILF, pszDstVar, pVar->value, pVar->value_length, 2164 !pVar->recursive, 0, o_local, f_simple, 0 /* !target_var */); 2165 if (iVer <= 2) 2166 pOutputMaybe = do_variable_definition_2(NILF, pszDstVar, pVar->value, pVar->value_length, 2167 !pVar->recursive, 0, o_local, f_simple, 0 /* !target_var */); 2165 2168 pOutputMaybe = do_variable_definition_2(NILF, "kbsrc_output_maybe", pVar->value, pVar->value_length, 2166 2169 !pVar->recursive, 0, o_local, f_simple, 0 /* !target_var */); … … 2168 2171 else 2169 2172 { 2170 pOutputMaybe = do_variable_definition_2(NILF, pszDstVar, "", 0, 1, 0, o_local, f_simple, 0 /* !target_var */); 2173 if (iVer <= 2) 2174 pOutputMaybe = do_variable_definition_2(NILF, pszDstVar, "", 0, 1, 0, o_local, f_simple, 0 /* !target_var */); 2171 2175 pOutputMaybe = do_variable_definition_2(NILF, "kbsrc_output_maybe", "", 0, 1, 0, o_local, f_simple, 0 /* !target_var */); 2172 2176 } … … 2181 2185 *psz++ = ' '; 2182 2186 memcpy(psz, pSource->value, pSource->value_length + 1); 2183 do_variable_definition_2(NILF, pszDstVar, pszVal, pVar->value_length + 1 + pDeps->value_length + 1 + pSource->value_length, 2184 !pVar->recursive && !pDeps->recursive && !pSource->recursive, 2185 NULL, o_local, f_simple, 0 /* !target_var */); 2187 if (iVer <= 2) 2188 do_variable_definition_2(NILF, pszDstVar, pszVal, pVar->value_length + 1 + pDeps->value_length + 1 + pSource->value_length, 2189 !pVar->recursive && !pDeps->recursive && !pSource->recursive, 2190 NULL, o_local, f_simple, 0 /* !target_var */); 2186 2191 do_variable_definition_2(NILF, "kbsrc_depend", pszVal, pVar->value_length + 1 + pDeps->value_length + 1 + pSource->value_length, 2187 2192 !pVar->recursive && !pDeps->recursive && !pSource->recursive, … … 2197 2202 *psz++ = ' '; 2198 2203 memcpy(psz, pOrderDeps->value, pOrderDeps->value_length + 1); 2199 do_variable_definition_2(NILF, pszDstVar, pszVal, 2200 pVar->value_length + 1 + pDirDep->value_length + 1 + pOrderDeps->value_length, 2201 !pVar->recursive && !pDirDep->recursive && !pOrderDeps->recursive, 2202 NULL, o_local, f_simple, 0 /* !target_var */); 2204 if (iVer <= 2) 2205 do_variable_definition_2(NILF, pszDstVar, pszVal, 2206 pVar->value_length + 1 + pDirDep->value_length + 1 + pOrderDeps->value_length, 2207 !pVar->recursive && !pDirDep->recursive && !pOrderDeps->recursive, 2208 NULL, o_local, f_simple, 0 /* !target_var */); 2203 2209 do_variable_definition_2(NILF, "kbsrc_depord", pszVal, 2204 2210 pVar->value_length + 1 + pDirDep->value_length + 1 + pOrderDeps->value_length, … … 2219 2225 memcpy(pszDstVar + pTarget->value_length, "_2_OBJS", sizeof("_2_OBJS")); 2220 2226 pVar = kbuild_query_recursive_variable_n(pszDstVar, pTarget->value_length + sizeof("_2_OBJS") - 1); 2221 fInstallOld Vars|= iVer <= 2 && (!pVar || !pVar->value_length);2227 fInstallOldObjsVar |= iVer <= 2 && (!pVar || !pVar->value_length); 2222 2228 if (pVar) 2223 2229 { … … 2235 2241 2236 2242 /* 2237 * Install legacy variable s.2238 */ 2239 if (fInstallOld Vars)2243 * Install legacy variable. 2244 */ 2245 if (fInstallOldObjsVar) 2240 2246 { 2241 2247 /* $(target)_OBJS_ = $($(target)_2_OBJS)*/ … … 2259 2265 $(eval $(def_target_source_rule)) 2260 2266 */ 2261 pVar = kbuild_get_recursive_variable("def_target_source_rule"); 2262 pszVal = variable_expand_string_2 (o, pVar->value, pVar->value_length, &psz); 2267 if (iVer > 2) 2268 { 2269 /*ifneq ($(TOOL_$(tool)_COMPILE_$(type)_USES_KOBJCACHE),)*/ 2270 int fUsesObjCache = 0; 2271 memcpy(pszSrc, "_USES_KOBJCACHE", sizeof("_USES_KOBJCACHE")); 2272 pVar = lookup_variable(pszSrcVar, pszSrc + sizeof("_USES_KOBJCACHE") - 1 - pszSrcVar); 2273 if (pVar) 2274 { 2275 if ( !pVar->recursive 2276 || IS_VARIABLE_RECURSIVE_WITHOUT_DOLLAR(pVar)) 2277 fUsesObjCache = pVar->value_length > 0; 2278 else 2279 { 2280 unsigned int cchTmp = 0; 2281 char *pszTmp = allocated_variable_expand_2(pVar->value, pVar->value_length, &cchTmp); 2282 free(pszTmp); 2283 fUsesObjCache = cchTmp > 0; 2284 } 2285 } 2286 if (!fUsesObjCache) 2287 pVar = kbuild_get_recursive_variable("def_target_source_rule_v3plus"); 2288 else 2289 pVar = kbuild_get_recursive_variable("def_target_source_rule_v3plus_objcache"); 2290 } 2291 else 2292 pVar = kbuild_get_recursive_variable("def_target_source_rule"); 2293 pszVal = variable_expand_string_2(o, pVar->value, pVar->value_length, &psz); 2263 2294 assert(!((size_t)pszVal & 3)); 2264 2295
Note:
See TracChangeset
for help on using the changeset viewer.