- Timestamp:
- Sep 29, 2006, 6:14:09 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gmake/kbuild.c
r544 r558 226 226 */ 227 227 static struct variable * 228 kbuild_first_prop(struct variable *pTarget, struct variable *pSource, 228 kbuild_first_prop(struct variable *pTarget, struct variable *pSource, 229 229 struct variable *pTool, struct variable *pType, 230 struct variable *pBldTrg, struct variable *pBldTrgArch, 230 struct variable *pBldTrg, struct variable *pBldTrgArch, 231 231 const char *pszPropF1, const char *pszPropF2, const char *pszVarName) 232 232 { … … 326 326 struct variable *pBldTrg, struct variable *pBldTrgArch, const char *pszVarName) 327 327 { 328 struct variable *pVar = kbuild_first_prop(pTarget, pSource, NULL, pType, pBldTrg, pBldTrgArch, 328 struct variable *pVar = kbuild_first_prop(pTarget, pSource, NULL, pType, pBldTrg, pBldTrgArch, 329 329 "TOOL", "TOOL", pszVarName); 330 330 if (!pVar) … … 366 366 */ 367 367 static struct variable * 368 kbuild_get_object_suffix(struct variable *pTarget, struct variable *pSource, 369 struct variable *pTool, struct variable *pType, 368 kbuild_get_object_suffix(struct variable *pTarget, struct variable *pSource, 369 struct variable *pTool, struct variable *pType, 370 370 struct variable *pBldTrg, struct variable *pBldTrgArch, const char *pszVarName) 371 371 { … … 412 412 struct variable *pPathSubCur = kbuild_get_variable("PATH_SUB_CURRENT"); 413 413 const char *pszSrcPrefix = NULL; 414 size_t cchSrcPrefix = 0; 414 415 const char *pszSrcEnd; 415 416 char *pszSrc; … … 427 428 pszSrc = pSource->value + pPathTarget->value_length; 428 429 pszSrcPrefix = "gen/"; 430 cchSrcPrefix = sizeof("gen/") - 1; 431 if ( *pszSrc == '/' 432 && !strncmp(pszSrc + 1, pTarget->value, pTarget->value_length) 433 && ( pszSrc[pTarget->value_length + 1] == '/' 434 || pszSrc[pTarget->value_length + 1] == '\0')) 435 pszSrc += 1 + pTarget->value_length; 429 436 } 430 437 else if ( pSource->value_length > pPathRoot->value_length … … 433 440 pszSrc = pSource->value + pPathRoot->value_length; 434 441 if ( *pszSrc == '/' 435 && !strncmp(pszSrc, pPathSubCur->value, pPathSubCur->value_length)) 442 && !strncmp(pszSrc + 1, pPathSubCur->value, pPathSubCur->value_length) 443 && ( pszSrc[pPathSubCur->value_length + 1] == '/' 444 || pszSrc[pPathSubCur->value_length + 1] == '\0')) 436 445 pszSrc += 1 + pPathSubCur->value_length; 437 446 } … … 479 488 + pTarget->value_length 480 489 + 1 /* slash */ 490 + cchSrcPrefix 481 491 + pszSrcEnd - pszSrc 482 492 + 1; … … 487 497 memcpy(psz, pTarget->value, pTarget->value_length); psz += pTarget->value_length; 488 498 *psz++ = '/'; 499 if (pszSrcPrefix) 500 { 501 memcpy(psz, pszSrcPrefix, cchSrcPrefix); 502 psz += cchSrcPrefix; 503 } 489 504 memcpy(psz, pszSrc, pszSrcEnd - pszSrc); psz += pszSrcEnd - pszSrc; 490 505 *psz = '\0'; … … 591 606 pSdks->cTargetSource = 0; 592 607 sprintf(pszTmp, "$(%s_%s_SDKS) $(%s_%s_SDKS.%s) $(%s_%s_SDKS.%s) $(%s_%s_SDKS.%s.%s)", 593 pTarget->value, pSource->value, 608 pTarget->value, pSource->value, 594 609 pTarget->value, pSource->value, pBldType->value, 595 610 pTarget->value, pSource->value, pBldTrg->value,
Note:
See TracChangeset
for help on using the changeset viewer.