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

Diff for /src/usr.bin/make/parse.c between version 1.76 and 1.77

version 1.76, 2007/07/24 18:58:48 version 1.77, 2007/07/30 09:32:02
Line 209 
Line 209 
 static int ParseFindMain(void *, void *);  static int ParseFindMain(void *, void *);
 static void ParseAddDir(void *, void *);  static void ParseAddDir(void *, void *);
 static void ParseClearPath(void *);  static void ParseClearPath(void *);
   
   static void add_target_node(const char *);
   static void add_target_nodes(const char *);
 static void ParseDoDependency(char *);  static void ParseDoDependency(char *);
 static void ParseAddCmd(void *, void *);  static void ParseAddCmd(void *, void *);
 static void ParseHasCommands(void *);  static void ParseHasCommands(void *);
Line 552 
Line 555 
     Lst_Init(path);      Lst_Init(path);
 }  }
   
   static void
   add_target_node(const char *line)
   {
           GNode *gn;
   
           if (!Suff_IsTransform(line))
                   gn = Targ_FindNode(line, TARG_CREATE);
           else
                   gn = Suff_AddTransform(line);
   
           if (gn != NULL)
                   Array_AtEnd(&gtargets, gn);
   }
   
   static void
   add_target_nodes(const char *line)
   {
   
           if (Dir_HasWildcards(line)) {
                   /*
                    * Targets are to be sought only in the current directory,
                    * so create an empty path for the thing. Note we need to
                    * use Dir_Destroy in the destruction of the path as the
                    * Dir module could have added a directory to the path...
                    */
                   char *targName;
                   LIST emptyPath;
                   LIST curTargs;
   
                   Lst_Init(&emptyPath);
                   Lst_Init(&curTargs);
                   Dir_Expand(line, &emptyPath, &curTargs);
                   Lst_Destroy(&emptyPath, Dir_Destroy);
                   while ((targName = (char *)Lst_DeQueue(&curTargs)) != NULL) {
                           add_target_node(line);
                   }
                   Lst_Destroy(&curTargs, NOFREE);
           } else {
                   add_target_node(line);
           }
   }
   
 /*-  /*-
  *---------------------------------------------------------------------   *---------------------------------------------------------------------
  * ParseDoDependency  --   * ParseDoDependency  --
Line 781 
Line 826 
          * the end of the targets list           * the end of the targets list
          */           */
         if (specType == Not && *line != '\0') {          if (specType == Not && *line != '\0') {
             char *targName;              add_target_nodes(line);
   
             if (Dir_HasWildcards(line)) {  
                 /*  
                  * Targets are to be sought only in the current directory,  
                  * so create an empty path for the thing. Note we need to  
                  * use Dir_Destroy in the destruction of the path as the  
                  * Dir module could have added a directory to the path...  
                  */  
                 LIST        emptyPath;  
                 LIST        curTargs;   /* list of target names to be found  
                                          * and added to the targets list */  
   
                 Lst_Init(&emptyPath);  
                 Lst_Init(&curTargs);  
                 Dir_Expand(line, &emptyPath, &curTargs);  
                 Lst_Destroy(&emptyPath, Dir_Destroy);  
             while ((targName = (char *)Lst_DeQueue(&curTargs)) != NULL) {  
                     if (!Suff_IsTransform(targName))  
                     gn = Targ_FindNode(targName, TARG_CREATE);  
                     else  
                     gn = Suff_AddTransform(targName);  
   
                     if (gn != NULL)  
                         Array_AtEnd(&gtargets, gn);  
                 }  
                 Lst_Destroy(&curTargs, NOFREE);  
             } else {  
                 if (!Suff_IsTransform(line))  
                     gn = Targ_FindNode(line, TARG_CREATE);  
                 else  
                     gn = Suff_AddTransform(line);  
   
                 if (gn != NULL)  
                     Array_AtEnd(&gtargets, gn);  
                 /* Don't need the list of target names anymore...  */  
             }  
         } else if (specType == ExPath && *line != '.' && *line != '\0')          } else if (specType == ExPath && *line != '.' && *line != '\0')
             Parse_Error(PARSE_WARNING, "Extra target (%s) ignored", line);              Parse_Error(PARSE_WARNING, "Extra target (%s) ignored", line);
   

Legend:
Removed from v.1.76  
changed lines
  Added in v.1.77