[BACK]Return to engine.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / make

Diff for /src/usr.bin/make/engine.c between version 1.35 and 1.36

version 1.35, 2012/10/04 13:20:46 version 1.36, 2012/10/06 09:32:40
Line 99 
Line 99 
 static char **recheck_command_for_shell(char **);  static char **recheck_command_for_shell(char **);
 static void list_parents(GNode *, FILE *);  static void list_parents(GNode *, FILE *);
   
   /* XXX due to a bug in make's logic, targets looking like *.a or -l*
    * have been silently dropped when make couldn't figure them out.
    * Now, we warn about them until all Makefile bugs have been fixed.
    */
   static bool
   drop_silently(const char *s)
   {
           size_t len;
   
           if (s[0] == '-' && s[1] == 'l')
                   return true;
   
           len = strlen(s);
           if (len >=2 && s[len-2] == '.' && s[len-1] == 'a')
                   return true;
           return false;
   }
   
 bool  bool
 node_find_valid_commands(GNode *gn)  node_find_valid_commands(GNode *gn)
 {  {
Line 111 
Line 129 
                 gn->type |= OP_SILENT;                  gn->type |= OP_SILENT;
   
         if (OP_NOP(gn->type) && Lst_IsEmpty(&gn->commands)) {          if (OP_NOP(gn->type) && Lst_IsEmpty(&gn->commands)) {
                 /* XXX */                  if (drop_silently(gn->name)) {
                 if ((gn->type & OP_LIB)) {  
                         printf("Warning: target %s", gn->name);                          printf("Warning: target %s", gn->name);
                         list_parents(gn, stdout);                          list_parents(gn, stdout);
                         printf(" does not have any command\n");                          printf(" does not have any command (BUG)\n");
                         return true;                          return true;
                 }                  }
                 /*                  /*
Line 586 
Line 603 
         job->exit_type = JOB_EXIT_OKAY;          job->exit_type = JOB_EXIT_OKAY;
         job->location = NULL;          job->location = NULL;
         job->flags = 0;          job->flags = 0;
           job->sent_signal = 0;
 }  }
   
 void  void
 job_handle_status(Job *job, int status)  job_handle_status(Job *job, int status)
 {  {
           bool silent;
   
           /* if there's one job running and we don't keep going, no need
            * to report right now.
            */
           if ((job->flags & JOB_ERRCHECK) && !keepgoing && runningJobs == NULL)
                   silent = !DEBUG(JOB);
           else
                   silent = false;
   
         debug_job_printf("Process %ld (%s) exited with status %d.\n",          debug_job_printf("Process %ld (%s) exited with status %d.\n",
             (long)job->pid, job->node->name, status);              (long)job->pid, job->node->name, status);
   
Line 598 
Line 626 
         if (WIFEXITED(status)) {          if (WIFEXITED(status)) {
                 job->code = WEXITSTATUS(status);/* exited */                  job->code = WEXITSTATUS(status);/* exited */
                 if (status != 0) {                  if (status != 0) {
                         printf("*** Error code %d", job->code);                          if (!silent)
                                   printf("*** Error %d", job->code);
                         job->exit_type = JOB_EXIT_BAD;                          job->exit_type = JOB_EXIT_BAD;
                 } else                  } else
                         job->exit_type = JOB_EXIT_OKAY;                          job->exit_type = JOB_EXIT_OKAY;
         } else {          } else {
                 job->exit_type = JOB_SIGNALED;                  job->exit_type = JOB_SIGNALED;
                 job->code = WTERMSIG(status);   /* signaled */                  job->code = WTERMSIG(status);   /* signaled */
                 printf("*** Signal %d", job->code);                  if (!silent)
                           printf("*** Signal %d", job->code);
         }          }
   
         /* if there is a problem, what's going on ? */          /* if there is a problem, what's going on ? */
         if (job->exit_type != JOB_EXIT_OKAY) {          if (job->exit_type != JOB_EXIT_OKAY) {
                 printf(" in target %s", job->node->name);                  if (!silent)
                           printf(" in target '%s'", job->node->name);
                 if (job->flags & JOB_ERRCHECK) {                  if (job->flags & JOB_ERRCHECK) {
                         job->node->built_status = ERROR;                          job->node->built_status = ERROR;
                         /* compute expensive status if we really want it */                          /* compute expensive status if we really want it */
                         if ((job->flags & JOB_SILENT) && job == &myjob)                          if ((job->flags & JOB_SILENT) && job == &myjob)
                                 determine_expensive_job(job);                                  determine_expensive_job(job);
                         if (!keepgoing) {                          if (!keepgoing) {
                                 printf("\n");                                  if (!silent)
                                           printf("\n");
                                 job->next = errorJobs;                                  job->next = errorJobs;
                                 errorJobs = job;                                  errorJobs = job;
                                 /* XXX don't free the command */                                  /* XXX don't free the command */

Legend:
Removed from v.1.35  
changed lines
  Added in v.1.36