Ignore:
Timestamp:
Jun 20, 2012, 12:44:52 AM (13 years ago)
Author:
bird
Message:

gnumake/current -> 3.82-cvs.

Location:
vendor/gnumake/current
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • vendor/gnumake/current

    • Property svn:ignore deleted
  • vendor/gnumake/current/rule.c

    r1989 r2596  
    11/* Pattern and suffix rule internals for GNU Make.
    22Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
    3 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
    4 Foundation, Inc.
     31998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
     42010 Free Software Foundation, Inc.
    55This file is part of GNU Make.
    66
     
    9797      for (dep = rule->deps; dep != 0; dep = dep->next)
    9898        {
    99           unsigned int len = strlen (dep->name);
     99          const char *dname = dep_name (dep);
     100          unsigned int len = strlen (dname);
    100101
    101102#ifdef VMS
    102           const char *p = strrchr (dep->name, ']');
     103          const char *p = strrchr (dname, ']');
    103104          const char *p2;
    104105          if (p == 0)
    105             p = strrchr (dep->name, ':');
    106           p2 = p != 0 ? strchr (dep->name, '%') : 0;
     106            p = strrchr (dname, ':');
     107          p2 = p != 0 ? strchr (dname, '%') : 0;
    107108#else
    108           const char *p = strrchr (dep->name, '/');
    109           const char *p2 = p != 0 ? strchr (dep->name, '%') : 0;
     109          const char *p = strrchr (dname, '/');
     110          const char *p2 = p != 0 ? strchr (dname, '%') : 0;
    110111#endif
    111           ndeps++;
     112          ndeps++;
    112113
    113114          if (len > max_pattern_dep_length)
     
    118119              /* There is a slash before the % in the dep name.
    119120                 Extract the directory name.  */
    120               if (p == dep->name)
     121              if (p == dname)
    121122                ++p;
    122               if (p - dep->name > namelen)
     123              if (p - dname > namelen)
    123124                {
    124                   namelen = p - dep->name;
     125                  namelen = p - dname;
    125126                  name = xrealloc (name, namelen + 1);
    126127                }
    127               memcpy (name, dep->name, p - dep->name);
    128               name[p - dep->name] = '\0';
     128              memcpy (name, dname, p - dname);
     129              name[p - dname] = '\0';
    129130
    130131              /* In the deps of an implicit rule the `changed' flag
     
    380381
    381382  ptr = p->dep;
    382   r->deps = (struct dep *) multi_glob (parse_file_seq (&ptr, '\0',
    383                                                        sizeof (struct dep), 1),
    384                                        sizeof (struct dep));
     383  r->deps = PARSE_FILE_SEQ (&ptr, struct dep, '\0', NULL, 0);
    385384
    386385  if (new_pattern_rule (r, 0))
     
    406405{
    407406  struct rule *next = rule->next;
    408   struct dep *dep;
    409 
    410   dep = rule->deps;
    411   while (dep)
    412     {
    413       struct dep *t = dep->next;
    414       free_dep (dep);
    415       dep = t;
    416     }
    417 
    418   free (rule->targets);
    419   free (rule->suffixes);
     407
     408  free_dep_chain (rule->deps);
     409
     410  /* MSVC erroneously warns without a cast here.  */
     411  free ((void *)rule->targets);
     412  free ((void *)rule->suffixes);
    420413  free (rule->lens);
    421414
     
    488481{
    489482  unsigned int i;
    490   struct dep *d;
    491483
    492484  for (i = 0; i < r->num; ++i)
     
    498490    putchar (':');
    499491
    500   for (d = r->deps; d != 0; d = d->next)
    501     printf (" %s", dep_name (d));
    502   putchar ('\n');
     492  print_prereqs (r->deps);
    503493
    504494  if (r->cmds != 0)
     
    547537         makefiles and thus count_implicit_rule_limits wasn't called yet.  */
    548538      if (num_pattern_rules != 0)
    549         fatal (NILF, _("BUG: num_pattern_rules wrong!  %u != %u"),
     539        fatal (NILF, _("BUG: num_pattern_rules is wrong!  %u != %u"),
    550540               num_pattern_rules, rules);
    551541    }
Note: See TracChangeset for help on using the changeset viewer.