- Timestamp:
- Feb 8, 2005, 10:19:09 AM (20 years ago)
- Location:
- trunk/src/gmake
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gmake/debug.h
r53 r218 25 25 #define DB_IMPLICIT (0x008) 26 26 #define DB_MAKEFILES (0x100) 27 #define DB_KMK (0x800) 27 28 28 29 #define DB_ALL (0xfff) -
trunk/src/gmake/file.c
r217 r218 527 527 { 528 528 if (f->deps == 0) 529 not_parallel = 1; 529 { 530 DB (DB_KMK, (_("not_parallel -1\n"))); 531 not_parallel = -1; 532 } 530 533 else 531 534 for (d = f->deps; d != 0; d = d->next) -
trunk/src/gmake/job.c
r217 r218 812 812 lastc->next = c->next; 813 813 814 /* update not_parallel if the file was flagged for that. */815 if ((c->file->command_flags & COMMANDS_NOTPARALLEL) && not_parallel >= 1)816 --not_parallel;817 818 814 free_child (c); 819 815 … … 1405 1401 { 1406 1402 /* Put this child on the chain of children waiting for the load average 1407 to go down. */1403 to go down. if not paralell, put it last. */ 1408 1404 set_command_state (f, cs_running); 1409 1405 c->next = waiting_jobs; 1410 waiting_jobs = c; 1406 if (c->next && (c->file->command_flags & COMMANDS_NOTPARALLEL)) 1407 { 1408 struct child *prev = waiting_jobs; 1409 while (prev->next) 1410 prev = prev->next; 1411 c->next = 0; 1412 prev->next = c; 1413 } 1414 else 1415 waiting_jobs = c; 1411 1416 return 0; 1412 1417 } 1413 1418 1414 1419 if (c->file->command_flags & COMMANDS_NOTPARALLEL) 1415 ++not_parallel; 1420 { 1421 assert(not_parallel == 0); 1422 DB (DB_KMK, (_("not_parallel %d -> %d (file=%p `%s')\n"), not_parallel, not_parallel + 1, c->file, c->file->name)); 1423 ++not_parallel; 1424 } 1425 1416 1426 1417 1427 /* Start the first command; reap_children will run later command lines. */ … … 1438 1448 case cs_finished: 1439 1449 notice_finished_file (f); 1440 if ((c->file->command_flags & COMMANDS_NOTPARALLEL) && not_parallel >= 1)1441 --not_parallel;1442 1450 free_child (c); 1443 1451 break; … … 1687 1695 (void) start_waiting_job (c); 1688 1696 1689 if (job_slots == 1 || not_parallel )1697 if (job_slots == 1 || not_parallel < 0) 1690 1698 /* Since there is only one job slot, make things run linearly. 1691 1699 Wait for the child to die, setting the state to `cs_finished'. */ … … 1934 1942 if (job_slots_used > 0) 1935 1943 --job_slots_used; 1936 1937 /* update not_parallel if the file was flagged for that. */1938 if ((c->file->command_flags & COMMANDS_NOTPARALLEL) && not_parallel >= 1)1939 --not_parallel;1940 1944 1941 1945 /* If the job failed, and the -k flag was not given, die. */ -
trunk/src/gmake/main.c
r217 r218 458 458 int posix_pedantic; 459 459 460 /* Nonzero if we have seen the `.NOTPARALLEL' target with empty dependency list. 461 Incremented while executing targets `.NOTPARALLEL' is depending on. 462 This temporarily or permanently turns off parallel builds. */ 460 /* Negative if we have seen the `.NOTPARALLEL' target with empty dependency list. 461 Zero if no `.NOTPARALLEL' or no file in the dependency list is being executed. 462 Positive when a file in `.NOTPARALLEL' is being made. 463 Nonzero values have the effect of disabeling parallel building. */ 463 464 464 465 int not_parallel; … … 592 593 case 'v': 593 594 db_level |= DB_BASIC | DB_VERBOSE; 595 break; 596 case 'k': 597 db_level |= DB_KMK; 594 598 break; 595 599 default: -
trunk/src/gmake/remake.c
r154 r218 726 726 int ran = file->command_state == cs_running; 727 727 int touched = 0; 728 728 DB (DB_JOBS, (_("notice_finished_file - entering: file=%p `%s' update_status=%d command_state=%d\n"), file, file->name, file->update_status, file->command_state)); 729 729 file->command_state = cs_finished; 730 730 file->updated = 1; 731 732 /* update not_parallel if the file was flagged for that. */ 733 if (ran && (file->command_flags & COMMANDS_NOTPARALLEL)) 734 { 735 assert(not_parallel == 1); 736 DB (DB_KMK, (_("not_parallel %d -> %d (file=%p `%s')\n"), not_parallel, not_parallel - 1, file, file->name)); 737 --not_parallel; 738 } 731 739 732 740 if (touch_flag … … 826 834 So mark it now as "succeeded". */ 827 835 file->update_status = 0; 836 837 DB (DB_JOBS, (_("notice_finished_file - leaving: file=%p `%s' update_status=%d command_state=%d\n"), file, file->name, file->update_status, file->command_state)); 828 838 } 829 839
Note:
See TracChangeset
for help on using the changeset viewer.