Print this page
make: remove more distributed mode code


 392         dmake_name2 = GETNAME(wcs_buffer, FIND_LENGTH);
 393         prop2 = get_prop(dmake_name2->prop, macro_prop);
 394         if (prop2 == NULL) {
 395                 /* DMAKE_OUTPUT_MODE not defined, default to TXT1 mode */
 396                 output_mode = txt1_mode;
 397         } else {
 398                 dmake_value2 = prop2->body.macro.value;
 399                 if ((dmake_value2 == NULL) ||
 400                     (IS_EQUAL(dmake_value2->string_mb, NOCATGETS("TXT1")))) {
 401                         output_mode = txt1_mode;
 402                 } else if (IS_EQUAL(dmake_value2->string_mb, NOCATGETS("TXT2"))) {
 403                         output_mode = txt2_mode;
 404                 } else if (IS_EQUAL(dmake_value2->string_mb, NOCATGETS("HTML1"))) {
 405                         output_mode = html1_mode;
 406                 } else {
 407                         warning(catgets(catd, 1, 352, "Unsupported value `%s' for DMAKE_OUTPUT_MODE after -x flag (ignored)"),
 408                               dmake_value2->string_mb);
 409                 }
 410         }
 411         /*
 412          * Find the dmake_mode: distributed, parallel, or serial.
 413          */
 414     if ((!pmake_cap_r_specified) &&
 415         (!pmake_machinesfile_specified)) {
 416         MBSTOWCS(wcs_buffer, NOCATGETS("DMAKE_MODE"));
 417         dmake_name2 = GETNAME(wcs_buffer, FIND_LENGTH);
 418         prop2 = get_prop(dmake_name2->prop, macro_prop);
 419         if (prop2 == NULL) {
 420                 /* DMAKE_MODE not defined, default to distributed mode */
 421                 dmake_mode_type = distributed_mode;
 422                 no_parallel = false;
 423         } else {
 424                 dmake_value2 = prop2->body.macro.value;
 425                 if ((dmake_value2 == NULL) ||
 426                     (IS_EQUAL(dmake_value2->string_mb, NOCATGETS("distributed")))) {
 427                         dmake_mode_type = distributed_mode;
 428                         no_parallel = false;
 429                 } else if (IS_EQUAL(dmake_value2->string_mb, NOCATGETS("parallel"))) {
 430                         dmake_mode_type = parallel_mode;
 431                         no_parallel = false;
 432                 } else if (IS_EQUAL(dmake_value2->string_mb, NOCATGETS("serial"))) {
 433                         dmake_mode_type = serial_mode;
 434                         no_parallel = true;
 435                 } else {
 436                         fatal(catgets(catd, 1, 307, "Unknown dmake mode argument `%s' after -m flag"), dmake_value2->string_mb);
 437                 }
 438         }
 439 
 440         if ((!list_all_targets) &&
 441             (report_dependencies_level == 0)) {
 442                 /*
 443                  * Check to see if either DMAKE_RCFILE or DMAKE_MODE is defined.
 444                  * They could be defined in the env, in the makefile, or on the
 445                  * command line.
 446                  * If neither is defined, and $(HOME)/.dmakerc does not exists,
 447                  * then print a message, and default to parallel mode.
 448                  */
 449                 if(dmake_mode_type == distributed_mode) {
 450                         dmake_mode_type = parallel_mode;
 451                         no_parallel = false;
 452                 }
 453         }
 454     }
 455 
 456         parallel_flag = true;
 457         putenv(strdup(NOCATGETS("DMAKE_CHILD=TRUE")));
 458 
 459 //
 460 // If dmake is running with -t option, set dmake_mode_type to serial.
 461 // This is done because doname() calls touch_command() that runs serially.
 462 // If we do not do that, maketool will have problems. 
 463 //
 464         if(touch) {
 465                 dmake_mode_type = serial_mode;
 466                 no_parallel = true;
 467         }
 468 
 469         /*
 470          * Check whether stdout and stderr are physically same.
 471          * This is in order to decide whether we need to redirect
 472          * stderr separately from stdout.
 473          * This check is performed only if __DMAKE_SEPARATE_STDERR


 763         Running                 rp;
 764 
 765         (void) fflush(stdout);
 766         if (childPid > 0) {
 767                 kill(childPid, SIGTERM);
 768                 childPid = -1;
 769         }
 770         for (rp = running_list; rp != NULL; rp = rp->next) {
 771                 if (rp->state != build_running) {
 772                         continue;
 773                 }
 774                 if (rp->pid > 0) {
 775                         kill(rp->pid, SIGTERM);
 776                         rp->pid = -1;
 777                 }
 778         }
 779         if (getpid() == getpgrp()) {
 780                 bsd_signal(SIGTERM, SIG_IGN);
 781                 kill (-getpid(), SIGTERM);
 782         }
 783         /* Clean up all parallel/distributed children already finished */
 784         finish_children(false);
 785 
 786         /* Make sure the processes running under us terminate first */
 787 
 788         while (wait((int *) NULL) != -1);
 789         /* Delete the current targets unless they are precious */
 790         if ((current_target != NULL) &&
 791             current_target->is_member &&
 792             ((member = get_prop(current_target->prop, member_prop)) != NULL)) {
 793                 current_target = member->body.member.library;
 794         }
 795         if (!do_not_exec_rule &&
 796             !touch &&
 797             !quest &&
 798             (current_target != NULL) &&
 799             !(current_target->stat.is_precious || all_precious)) {
 800 
 801 /* BID_1030811 */
 802 /* azv 16 Oct 95 */
 803                 current_target->stat.time = file_no_time; 


1772         Boolean                 is_xpg4;
1773 
1774 /*
1775  *      Remember current mode. It may be changed after reading makefile
1776  *      and we will have to correct MAKEFLAGS variable.
1777  */
1778         is_xpg4 = posix;
1779 
1780         MBSTOWCS(wcs_buffer, NOCATGETS("KEEP_STATE"));
1781         keep_state_name = GETNAME(wcs_buffer, FIND_LENGTH);
1782         MBSTOWCS(wcs_buffer, NOCATGETS("Makefile"));
1783         Makefile = GETNAME(wcs_buffer, FIND_LENGTH);
1784         MBSTOWCS(wcs_buffer, NOCATGETS("makefile"));
1785         makefile_name = GETNAME(wcs_buffer, FIND_LENGTH);
1786         MBSTOWCS(wcs_buffer, NOCATGETS("s.makefile"));
1787         sdotmakefile_name = GETNAME(wcs_buffer, FIND_LENGTH);
1788         MBSTOWCS(wcs_buffer, NOCATGETS("s.Makefile"));
1789         sdotMakefile = GETNAME(wcs_buffer, FIND_LENGTH);
1790 
1791 /*
1792  *      Set flag if NSE is active
1793  */
1794 
1795 /*
1796  *      initialize global dependency entry for .NOT_AUTO
1797  */
1798         not_auto_depen->next = NULL;
1799         not_auto_depen->name = not_auto;
1800         not_auto_depen->automatic = not_auto_depen->stale = false;
1801 
1802 /*
1803  *      Read internal definitions and rules.
1804  */
1805         if (read_trace_level > 1) {
1806                 trace_reader = true;
1807         }
1808         if (!ignore_default_mk) {
1809                 if (svr4) {
1810                         MBSTOWCS(wcs_buffer, NOCATGETS("svr4.make.rules"));
1811                         default_makefile = GETNAME(wcs_buffer, FIND_LENGTH);
1812                 } else {
1813                         MBSTOWCS(wcs_buffer, NOCATGETS("make.rules"));
1814                         default_makefile = GETNAME(wcs_buffer, FIND_LENGTH);
1815                 }




 392         dmake_name2 = GETNAME(wcs_buffer, FIND_LENGTH);
 393         prop2 = get_prop(dmake_name2->prop, macro_prop);
 394         if (prop2 == NULL) {
 395                 /* DMAKE_OUTPUT_MODE not defined, default to TXT1 mode */
 396                 output_mode = txt1_mode;
 397         } else {
 398                 dmake_value2 = prop2->body.macro.value;
 399                 if ((dmake_value2 == NULL) ||
 400                     (IS_EQUAL(dmake_value2->string_mb, NOCATGETS("TXT1")))) {
 401                         output_mode = txt1_mode;
 402                 } else if (IS_EQUAL(dmake_value2->string_mb, NOCATGETS("TXT2"))) {
 403                         output_mode = txt2_mode;
 404                 } else if (IS_EQUAL(dmake_value2->string_mb, NOCATGETS("HTML1"))) {
 405                         output_mode = html1_mode;
 406                 } else {
 407                         warning(catgets(catd, 1, 352, "Unsupported value `%s' for DMAKE_OUTPUT_MODE after -x flag (ignored)"),
 408                               dmake_value2->string_mb);
 409                 }
 410         }
 411         /*
 412          * Find the dmake_mode: parallel, or serial.
 413          */
 414     if ((!pmake_cap_r_specified) &&
 415         (!pmake_machinesfile_specified)) {
 416         MBSTOWCS(wcs_buffer, NOCATGETS("DMAKE_MODE"));
 417         dmake_name2 = GETNAME(wcs_buffer, FIND_LENGTH);
 418         prop2 = get_prop(dmake_name2->prop, macro_prop);
 419         if (prop2 == NULL) {
 420                 /* DMAKE_MODE not defined, default to parallel mode */
 421                 dmake_mode_type = parallel_mode;
 422                 no_parallel = false;
 423         } else {
 424                 dmake_value2 = prop2->body.macro.value;
 425                 if (IS_EQUAL(dmake_value2->string_mb, NOCATGETS("parallel"))) {




 426                         dmake_mode_type = parallel_mode;
 427                         no_parallel = false;
 428                 } else if (IS_EQUAL(dmake_value2->string_mb, NOCATGETS("serial"))) {
 429                         dmake_mode_type = serial_mode;
 430                         no_parallel = true;
 431                 } else {
 432                         fatal(catgets(catd, 1, 307, "Unknown dmake mode argument `%s' after -m flag"), dmake_value2->string_mb);
 433                 }
 434         }
 435 














 436     }
 437 
 438         parallel_flag = true;
 439         putenv(strdup(NOCATGETS("DMAKE_CHILD=TRUE")));
 440 
 441 //
 442 // If dmake is running with -t option, set dmake_mode_type to serial.
 443 // This is done because doname() calls touch_command() that runs serially.
 444 // If we do not do that, maketool will have problems. 
 445 //
 446         if(touch) {
 447                 dmake_mode_type = serial_mode;
 448                 no_parallel = true;
 449         }
 450 
 451         /*
 452          * Check whether stdout and stderr are physically same.
 453          * This is in order to decide whether we need to redirect
 454          * stderr separately from stdout.
 455          * This check is performed only if __DMAKE_SEPARATE_STDERR


 745         Running                 rp;
 746 
 747         (void) fflush(stdout);
 748         if (childPid > 0) {
 749                 kill(childPid, SIGTERM);
 750                 childPid = -1;
 751         }
 752         for (rp = running_list; rp != NULL; rp = rp->next) {
 753                 if (rp->state != build_running) {
 754                         continue;
 755                 }
 756                 if (rp->pid > 0) {
 757                         kill(rp->pid, SIGTERM);
 758                         rp->pid = -1;
 759                 }
 760         }
 761         if (getpid() == getpgrp()) {
 762                 bsd_signal(SIGTERM, SIG_IGN);
 763                 kill (-getpid(), SIGTERM);
 764         }
 765         /* Clean up all parallel children already finished */
 766         finish_children(false);
 767 
 768         /* Make sure the processes running under us terminate first */
 769 
 770         while (wait((int *) NULL) != -1);
 771         /* Delete the current targets unless they are precious */
 772         if ((current_target != NULL) &&
 773             current_target->is_member &&
 774             ((member = get_prop(current_target->prop, member_prop)) != NULL)) {
 775                 current_target = member->body.member.library;
 776         }
 777         if (!do_not_exec_rule &&
 778             !touch &&
 779             !quest &&
 780             (current_target != NULL) &&
 781             !(current_target->stat.is_precious || all_precious)) {
 782 
 783 /* BID_1030811 */
 784 /* azv 16 Oct 95 */
 785                 current_target->stat.time = file_no_time; 


1754         Boolean                 is_xpg4;
1755 
1756 /*
1757  *      Remember current mode. It may be changed after reading makefile
1758  *      and we will have to correct MAKEFLAGS variable.
1759  */
1760         is_xpg4 = posix;
1761 
1762         MBSTOWCS(wcs_buffer, NOCATGETS("KEEP_STATE"));
1763         keep_state_name = GETNAME(wcs_buffer, FIND_LENGTH);
1764         MBSTOWCS(wcs_buffer, NOCATGETS("Makefile"));
1765         Makefile = GETNAME(wcs_buffer, FIND_LENGTH);
1766         MBSTOWCS(wcs_buffer, NOCATGETS("makefile"));
1767         makefile_name = GETNAME(wcs_buffer, FIND_LENGTH);
1768         MBSTOWCS(wcs_buffer, NOCATGETS("s.makefile"));
1769         sdotmakefile_name = GETNAME(wcs_buffer, FIND_LENGTH);
1770         MBSTOWCS(wcs_buffer, NOCATGETS("s.Makefile"));
1771         sdotMakefile = GETNAME(wcs_buffer, FIND_LENGTH);
1772 
1773 /*




1774  *      initialize global dependency entry for .NOT_AUTO
1775  */
1776         not_auto_depen->next = NULL;
1777         not_auto_depen->name = not_auto;
1778         not_auto_depen->automatic = not_auto_depen->stale = false;
1779 
1780 /*
1781  *      Read internal definitions and rules.
1782  */
1783         if (read_trace_level > 1) {
1784                 trace_reader = true;
1785         }
1786         if (!ignore_default_mk) {
1787                 if (svr4) {
1788                         MBSTOWCS(wcs_buffer, NOCATGETS("svr4.make.rules"));
1789                         default_makefile = GETNAME(wcs_buffer, FIND_LENGTH);
1790                 } else {
1791                         MBSTOWCS(wcs_buffer, NOCATGETS("make.rules"));
1792                         default_makefile = GETNAME(wcs_buffer, FIND_LENGTH);
1793                 }