Changeset 2596 for vendor/gnumake/current/rule.c
- Timestamp:
- Jun 20, 2012, 12:44:52 AM (13 years ago)
- 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 1 1 /* Pattern and suffix rule internals for GNU Make. 2 2 Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 3 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software4 Foundation, Inc.3 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 4 2010 Free Software Foundation, Inc. 5 5 This file is part of GNU Make. 6 6 … … 97 97 for (dep = rule->deps; dep != 0; dep = dep->next) 98 98 { 99 unsigned int len = strlen (dep->name); 99 const char *dname = dep_name (dep); 100 unsigned int len = strlen (dname); 100 101 101 102 #ifdef VMS 102 const char *p = strrchr (dep->name, ']');103 const char *p = strrchr (dname, ']'); 103 104 const char *p2; 104 105 if (p == 0) 105 p = strrchr (d ep->name, ':');106 p2 = p != 0 ? strchr (d ep->name, '%') : 0;106 p = strrchr (dname, ':'); 107 p2 = p != 0 ? strchr (dname, '%') : 0; 107 108 #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; 110 111 #endif 111 112 ndeps++; 112 113 113 114 if (len > max_pattern_dep_length) … … 118 119 /* There is a slash before the % in the dep name. 119 120 Extract the directory name. */ 120 if (p == d ep->name)121 if (p == dname) 121 122 ++p; 122 if (p - d ep->name > namelen)123 if (p - dname > namelen) 123 124 { 124 namelen = p - d ep->name;125 namelen = p - dname; 125 126 name = xrealloc (name, namelen + 1); 126 127 } 127 memcpy (name, d ep->name, p - dep->name);128 name[p - d ep->name] = '\0';128 memcpy (name, dname, p - dname); 129 name[p - dname] = '\0'; 129 130 130 131 /* In the deps of an implicit rule the `changed' flag … … 380 381 381 382 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); 385 384 386 385 if (new_pattern_rule (r, 0)) … … 406 405 { 407 406 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); 420 413 free (rule->lens); 421 414 … … 488 481 { 489 482 unsigned int i; 490 struct dep *d;491 483 492 484 for (i = 0; i < r->num; ++i) … … 498 490 putchar (':'); 499 491 500 for (d = r->deps; d != 0; d = d->next) 501 printf (" %s", dep_name (d)); 502 putchar ('\n'); 492 print_prereqs (r->deps); 503 493 504 494 if (r->cmds != 0) … … 547 537 makefiles and thus count_implicit_rule_limits wasn't called yet. */ 548 538 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"), 550 540 num_pattern_rules, rules); 551 541 }
Note:
See TracChangeset
for help on using the changeset viewer.