Changeset 2886 in kBuild
- Timestamp:
- Sep 6, 2016 2:31:46 PM (9 years ago)
- Location:
- trunk/src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kDepPre/Makefile.kmk
r2413 r2886 29 29 PROGRAMS += kDepPre 30 30 kDepPre_TEMPLATE = BIN 31 kDepPre_LIBS = $(LIB_KDEP) 31 kDepPre_LIBS = $(LIB_KDEP) $(LIB_KUTIL) 32 32 kDepPre_DEFS.linux = HAVE_FGETC_UNLOCKED=1 33 33 if1of ($(KBUILD_TARGET), win nt) -
trunk/src/kmk/Makefile.kmk
r2856 r2886 259 259 # 260 260 kmk_DEFS += CONFIG_WITH_KMK_BUILTIN 261 kmk_LIBS += $(LIB_KUTIL) $(LIB_KDEP)261 kmk_LIBS += $(LIB_KUTIL) #$(LIB_KDEP) 262 262 kmk_SOURCES += \ 263 263 kmkbuiltin.c \ … … 274 274 kmkbuiltin/kDepIDB.c \ 275 275 kmkbuiltin/kDepObj.c \ 276 ../lib/kDep.c \ 276 277 kmkbuiltin/md5sum.c \ 277 278 kmkbuiltin/mkdir.c \ … … 283 284 kmkbuiltin/kSubmit.c \ 284 285 kmkbuiltin/sleep.c \ 285 kmkbuiltin/test.c \286 kmkbuiltin/test.c 286 287 287 288 ## @todo kmkbuiltin/redirect.c … … 418 419 kDepIDB_DEFS = kmk_builtin_kDepIDB=main 419 420 kDepIDB_INCS = . 420 kDepIDB_LIBS = $(LIB_KDEP) 421 kDepIDB_LIBS = $(LIB_KDEP) $(LIB_KUTIL) 421 422 kDepIDB_SOURCES = \ 422 423 kmkbuiltin/kDepIDB.c … … 425 426 kDepObj_DEFS = kmk_builtin_kDepObj=main 426 427 kDepObj_INCS = . 427 kDepObj_LIBS = $(LIB_KDEP) 428 kDepObj_LIBS = $(LIB_KDEP) $(LIB_KUTIL) 428 429 kDepObj_SOURCES = \ 429 430 kmkbuiltin/kDepObj.c -
trunk/src/kmk/dir-nt-bird.c
r2879 r2886 75 75 /** Number of times dir_cache_invalid_missing was called. */ 76 76 static KU32 g_cInvalidates = 0; 77 /** Set by dir_cache_volatile_dir to indicate that the user has marked the 78 * volatile parts of the file system with custom revisioning and we only need to 79 * flush these. This is very handy when using a separate output directory 80 * from the sources. */ 81 static KBOOL g_fFsCacheIsUsingCustomRevision = K_FALSE; 77 82 78 83 … … 505 510 } 506 511 507 508 /** 509 * Invalidate missing bits of the directory cache. 510 * 511 * This is called each time a make job completes. 512 */ 513 void dir_cache_invalid_missing(void) 512 /** 513 * Do cache invalidation after a job completes. 514 */ 515 void dir_cache_invalid_after_job(void) 516 { 517 g_cInvalidates++; 518 if (g_fFsCacheIsUsingCustomRevision) 519 kFsCacheInvalidateCustomBoth(g_pFsCache); 520 else 521 kFsCacheInvalidateAll(g_pFsCache); 522 } 523 524 /** 525 * Invalidate the whole directory cache 526 * 527 * Used by $(dircache-ctl invalidate) 528 */ 529 void dir_cache_invalid_all(void) 514 530 { 515 531 g_cInvalidates++; … … 517 533 } 518 534 535 /** 536 * Invalidate missing bits of the directory cache. 537 * 538 * Used by $(dircache-ctl invalidate-missing) 539 */ 540 void dir_cache_invalid_missing(void) 541 { 542 g_cInvalidates++; 543 kFsCacheInvalidateAll(g_pFsCache); 544 } 545 546 /** 547 * Invalidate the volatile bits of the directory cache. 548 * 549 * Used by $(dircache-ctl invalidate-missing) 550 */ 551 void dir_cache_invalid_volatile(void) 552 { 553 g_cInvalidates++; 554 if (g_fFsCacheIsUsingCustomRevision) 555 kFsCacheInvalidateCustomBoth(g_pFsCache); 556 else 557 kFsCacheInvalidateAll(g_pFsCache); 558 } 559 560 /** 561 * Used by $(dircache-ctl ) to mark a directory subtree or file as volatile. 562 * 563 * The first call changes the rest of the cache to be considered non-volatile. 564 * 565 * @returns 0 on success, -1 on failure. 566 * @param pszDir The directory (or file for what that is worth). 567 */ 568 int dir_cache_volatile_dir(const char *pszDir) 569 { 570 KFSLOOKUPERROR enmError; 571 PKFSOBJ pObj = kFsCacheLookupA(g_pFsCache, pszDir, &enmError); 572 if (pObj) 573 { 574 KBOOL fRc = kFsCacheSetupCustomRevisionForTree(g_pFsCache, pObj); 575 kFsCacheObjRelease(g_pFsCache, pObj); 576 if (fRc) 577 { 578 g_fFsCacheIsUsingCustomRevision = K_TRUE; 579 return 0; 580 } 581 error(reading_file, "failed to mark '%s' as volatile", pszDir); 582 } 583 else 584 error(reading_file, "failed to mark '%s' as volatile (not found)", pszDir); 585 return -1; 586 } 587 -
trunk/src/kmk/function.c
r2788 r2886 5457 5457 } 5458 5458 5459 5460 /* Controls the cache in dir-bird-nt.c. */ 5461 5462 char * 5463 func_dircache_ctl (char *o, char **argv UNUSED, const char *funcname UNUSED) 5464 { 5465 # ifdef KBUILD_OS_WINDOWS 5466 const char *cmd = argv[0]; 5467 while (isblank ((unsigned char)*cmd)) 5468 cmd++; 5469 if (strcmp (cmd, "invalidate") == 0) 5470 { 5471 if (argv[1] != NULL) 5472 error (reading_file, "$(dircache-ctl invalidate) takes no parameters"); 5473 dir_cache_invalid_all (); 5474 } 5475 else if (strcmp (cmd, "invalidate-missing") == 0) 5476 { 5477 if (argv[1] != NULL) 5478 error (reading_file, "$(dircache-ctl invalidate-missing) takes no parameters"); 5479 dir_cache_invalid_missing (); 5480 } 5481 else if (strcmp (cmd, "volatile") == 0) 5482 { 5483 size_t i; 5484 for (i = 1; argv[i] != NULL; i++) 5485 { 5486 const char *dir = argv[i]; 5487 while (isblank ((unsigned char)*dir)) 5488 dir++; 5489 if (*dir) 5490 dir_cache_volatile_dir (dir); 5491 } 5492 } 5493 else 5494 error (reading_file, "Unknown $(dircache-ctl ) command: '%s'", cmd); 5495 # endif 5496 return o; 5497 } 5498 5459 5499 #endif /* KMK */ 5460 5500 … … 5645 5685 #endif 5646 5686 #ifdef KMK 5687 { STRING_SIZE_TUPLE("dircache-ctl"), 1, 0, 1, func_dircache_ctl}, 5647 5688 { STRING_SIZE_TUPLE("breakpoint"), 0, 0, 0, func_breakpoint}, 5648 5689 { STRING_SIZE_TUPLE("set-umask"), 1, 3, 1, func_set_umask}, -
trunk/src/kmk/make.h
r2758 r2886 980 980 extern char *abspath(const char *name, char *apath); 981 981 extern char *func_breakpoint(char *o, char **argv, const char *funcname); 982 # ifdef KBUILD_OS_WINDOWS 983 extern void dir_cache_invalid_after_job (void); 984 extern void dir_cache_invalid_all (void); 985 extern void dir_cache_invalid_missing (void); 986 extern int dir_cache_volatile_dir (const char *dir); 987 # endif 982 988 #endif 983 989 -
trunk/src/kmk/w32/subproc/sub_proc.c
r2862 r2886 272 272 job has completed and possibly created new files that 273 273 was missing earlier. */ 274 extern void dir_cache_invalid_missing(void); 275 dir_cache_invalid_missing(); 274 dir_cache_invalid_after_job (); 276 275 277 276 if (pproc->enmType == kRegular) { -
trunk/src/lib/Makefile.kmk
r2856 r2886 31 31 kDep_DEFS.win += NEED_ISBLANK=1 __WIN32__=1 32 32 kDep_SOURCES = kDep.c 33 kDep_SOURCES.win = nt_fullpath.c34 33 kDep_NOINST = 1 35 34 -
trunk/src/lib/kDep.c
r2851 r2886 33 33 * Header Files * 34 34 *******************************************************************************/ 35 #ifdef KMK /* For when it gets compiled and linked into kmk. */ 36 # include "make.h" 37 #endif 35 38 #include <stdio.h> 36 39 #include <stdlib.h> … … 46 49 # include <io.h> 47 50 # include <Windows.h> 48 extern void nt_fullpath(const char *pszPath, char *pszFull, size_t cchFull); /* nt_fullpath.c */ 51 # include "nt_fullpath.h" 52 # include "nt/ntstat.h" 49 53 #else 50 54 # include <dirent.h> … … 195 199 #endif 196 200 char *pszFilename; 201 #ifndef KMK 197 202 struct stat s; 203 #endif 198 204 199 205 /* … … 220 226 { 221 227 #if K_OS == K_OS_WINDOWS 222 nt_fullpath (pszFilename, szFilename, sizeof(szFilename));228 nt_fullpath_cached(pszFilename, szFilename, sizeof(szFilename)); 223 229 fixslash(szFilename); 224 230 #else … … 233 239 * Check that the file exists before we start depending on it. 234 240 */ 235 if (stat(pszFilename, &s)) 241 #ifdef KMK 242 if (!file_exists_p(pszFilename)) 243 #elif K_OS == K_OS_WINDOWS 244 if (birdStatModTimeOnly(pszFilename, &s.st_mtim, 1 /*fFollowLink*/) != 0) 245 #else 246 if (stat(pszFilename, &s) != 0) 247 #endif 236 248 { 237 249 if ( !fQuiet
Note:
See TracChangeset
for help on using the changeset viewer.