Changeset 217


Ignore:
Timestamp:
Feb 8, 2005, 8:22:20 AM (20 years ago)
Author:
bird
Message:

More proper .NOTPARALLEL.

Location:
trunk/src/gmake
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/src/gmake/commands.h

    r53 r217  
    3636#define COMMANDS_SILENT         2 /* Silent: @.  */
    3737#define COMMANDS_NOERROR        4 /* No errors: -.  */
     38#define COMMANDS_NOTPARALLEL    64 /* kmk: the commands must be executed alone. */
    3839
    3940extern void execute_file_commands PARAMS ((struct file *file));
  • TabularUnified trunk/src/gmake/file.c

    r154 r217  
    522522    posix_pedantic = 1;
    523523
     524  /* kmk changed */
    524525  f = lookup_file (".NOTPARALLEL");
    525526  if (f != 0 && f->is_target)
    526     not_parallel = 1;
     527    {
     528      if (f->deps == 0)
     529        not_parallel = 1;
     530      else
     531        for (d = f->deps; d != 0; d = d->next)
     532          for (f2 = d->file; f2 != 0; f2 = f2->prev)
     533            f2->command_flags |= COMMANDS_NOTPARALLEL;
     534    }
     535
    527536}
    528537
  • TabularUnified trunk/src/gmake/job.c

    r192 r217  
    812812        lastc->next = c->next;
    813813
     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
    814818      free_child (c);
    815819
     
    13971401  /* If we are running at least one job already and the load average
    13981402     is too high, make this one wait.  */
    1399   if (!c->remote && job_slots_used > 0 && load_too_high ())
     1403  if (!c->remote && job_slots_used > 0 &&
     1404      (not_parallel || (c->file->command_flags & COMMANDS_NOTPARALLEL) || load_too_high ()))
    14001405    {
    14011406      /* Put this child on the chain of children waiting for the load average
     
    14061411      return 0;
    14071412    }
     1413
     1414  if (c->file->command_flags & COMMANDS_NOTPARALLEL)
     1415    ++not_parallel;
    14081416
    14091417  /* Start the first command; reap_children will run later command lines.  */
     
    14301438    case cs_finished:
    14311439      notice_finished_file (f);
     1440      if ((c->file->command_flags & COMMANDS_NOTPARALLEL) && not_parallel >= 1)
     1441        --not_parallel;
    14321442      free_child (c);
    14331443      break;
     
    19241934    if (job_slots_used > 0)
    19251935      --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;
    19261940
    19271941    /* If the job failed, and the -k flag was not given, die.  */
  • TabularUnified trunk/src/gmake/main.c

    r160 r217  
    458458int posix_pedantic;
    459459
    460 /* Nonzero if we have seen the `.NOTPARALLEL' target.
    461    This turns off parallel builds for this invocation of make.  */
     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. */
    462463
    463464int not_parallel;
Note: See TracChangeset for help on using the changeset viewer.