[BACK]Return to main.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / usr.bin / make

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/usr.bin/make/main.c between version 1.229 and 1.230

version 1.229, 2014/08/23 15:05:40 version 1.230, 2014/09/07 20:55:34
Line 182  static const char * tracefile;
Line 182  static const char * tracefile;
 static void             MainParseArgs(int, char **);  static void             MainParseArgs(int, char **);
 static int              ReadMakefile(const void *, const void *);  static int              ReadMakefile(const void *, const void *);
 static void             usage(void) MAKE_ATTR_DEAD;  static void             usage(void) MAKE_ATTR_DEAD;
 static int              MarkSysMkTargets(void *, void *);  
   
 static Boolean          ignorePWD;      /* if we use -C, PWD is meaningless */  static Boolean          ignorePWD;      /* if we use -C, PWD is meaningless */
 static char objdir[MAXPATHLEN + 1];     /* where we chdir'ed to */  static char objdir[MAXPATHLEN + 1];     /* where we chdir'ed to */
Line 1205  main(int argc, char **argv)
Line 1204  main(int argc, char **argv)
                         Fatal("%s: cannot open %s.", progname,                          Fatal("%s: cannot open %s.", progname,
                             (char *)Lst_Datum(ln));                              (char *)Lst_Datum(ln));
         }          }
         /*  
          * Rules from system makefiles are somewhat special.  For instance,  
          * they're not eligible to become main targets.  A sensible sys.mk  
          * only contains suffix transformations and variables, but clearing  
          * the suffix list makes suffix transformations into regular rules,  
          * which could otherwise become main targets.  
          */  
         Lst_ForEach(Targ_List(), MarkSysMkTargets, NULL);  
   
         if (!Lst_IsEmpty(makefiles)) {          if (!Lst_IsEmpty(makefiles)) {
                 LstNode ln;                  LstNode ln;
Line 1384  main(int argc, char **argv)
Line 1375  main(int argc, char **argv)
         if (enterFlag)          if (enterFlag)
                 printf("%s: Leaving directory `%s'\n", progname, curdir);                  printf("%s: Leaving directory `%s'\n", progname, curdir);
   
           Suff_End();
         Targ_End();          Targ_End();
         Suff_End(); /* targets refer to suffixes, clean after Targ */  
         Arch_End();          Arch_End();
         Var_End();          Var_End();
         Parse_End();          Parse_End();
Line 1497  Cmd_Exec(const char *cmd, const char **e
Line 1488  Cmd_Exec(const char *cmd, const char **e
     int         status;         /* command exit status */      int         status;         /* command exit status */
     Buffer      buf;            /* buffer to store the result */      Buffer      buf;            /* buffer to store the result */
     char        *cp;      char        *cp;
     int         cc;             /* bytes read, or -1 */      int         cc;
     int         savederr;       /* saved errno */  
   
   
     *errnum = NULL;      *errnum = NULL;
     savederr = 0;  
   
     if (!shellName)      if (!shellName)
         Shell_Init();          Shell_Init();
Line 1565  Cmd_Exec(const char *cmd, const char **e
Line 1554  Cmd_Exec(const char *cmd, const char **e
                 Buf_AddBytes(&buf, cc, result);                  Buf_AddBytes(&buf, cc, result);
         }          }
         while (cc > 0 || (cc == -1 && errno == EINTR));          while (cc > 0 || (cc == -1 && errno == EINTR));
         if (cc == -1)  
             savederr = errno;  
   
         /*          /*
          * Close the input side of the pipe.           * Close the input side of the pipe.
Line 1583  Cmd_Exec(const char *cmd, const char **e
Line 1570  Cmd_Exec(const char *cmd, const char **e
         cc = Buf_Size(&buf);          cc = Buf_Size(&buf);
         res = Buf_Destroy(&buf, FALSE);          res = Buf_Destroy(&buf, FALSE);
   
         if (savederr != 0)          if (cc == 0)
             *errnum = "Couldn't read shell's output for \"%s\"";              *errnum = "Couldn't read shell's output for \"%s\"";
   
         if (WIFSIGNALED(status))          if (WIFSIGNALED(status))
Line 1828  usage(void)
Line 1815  usage(void)
         exit(2);          exit(2);
 }  }
   
 /*-  
  *-----------------------------------------------------------------------  
  * MarkSysMkTargets -- set OP_FROM_SYS_MK on a target node in Lst_ForEach().  
  *  
  * Input:  
  *      target  node to set the attribute on (GNode *)  
  *  
  * Results:  
  *      Always 0 to not abort Lst_ForEach() prematurely.  
  *-----------------------------------------------------------------------  
  */  
 static int  
 MarkSysMkTargets(void *target, void *unused)  
 {  
     (void)unused;  
     ((GNode *)target)->type |= OP_FROM_SYS_MK;  
     return 0;  
 }  
   
   
 int  int
 PrintAddr(void *a, void *b)  PrintAddr(void *a, void *b)

Legend:
Removed from v.1.229  
changed lines
  Added in v.1.230

CVSweb <webmaster@jp.NetBSD.org>