Changeset 2591 for trunk/src/kmk/rule.c
- Timestamp:
- Jun 17, 2012, 10:45:31 PM (13 years ago)
- Location:
- trunk/src/kmk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk
- Property svn:ignore
-
old new 13 13 stamp-* 14 14 makebook* 15 15 16 .*gdbinit 17 .gdb_history 18 16 19 *.dep 17 20 *.dvi … … 31 34 *.pg 32 35 *.pgs 36 33 37 README 34 38 README.DOS 35 39 README.W32 40 README.OS2 36 41 aclocal.m4 37 42 autom4te.cache … … 52 57 config.h.W32 53 58 config.h-vms 59 54 60 loadavg 55 61 loadavg.c 56 62 make 63 57 64 .deps 58 65 .dep_segment 66 ID 67 TAGS 68 59 69 _* 60 70 sun4 … … 72 82 sol2 73 83 i486-linux 84 74 85 customs 86 75 87 install-sh 76 88 mkinstalldirs 89 90 .directive.asc
-
- Property svn:ignore
-
trunk/src/kmk/rule.c
r2137 r2591 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 #ifndef CONFIG_WITH_ALLOC_CACHES 383 r->deps = (struct dep *) multi_glob (parse_file_seq (&ptr, '\0', 384 sizeof (struct dep), 1), 385 sizeof (struct dep)); 386 #else 387 r->deps = (struct dep *) multi_glob (parse_file_seq (&ptr, '\0', 388 &dep_cache, 1), 389 &dep_cache); 390 #endif 383 r->deps = PARSE_FILE_SEQ (&ptr, struct dep, '\0', NULL, 0); 391 384 392 385 if (new_pattern_rule (r, 0)) … … 419 412 { 420 413 struct rule *next = rule->next; 421 struct dep *dep; 422 423 dep = rule->deps; 424 while (dep) 425 { 426 struct dep *t = dep->next; 427 free_dep (dep); 428 dep = t; 429 } 430 431 free (rule->targets); 432 free (rule->suffixes); 414 415 free_dep_chain (rule->deps); 416 417 /* MSVC erroneously warns without a cast here. */ 418 free ((void *)rule->targets); 419 free ((void *)rule->suffixes); 433 420 free (rule->lens); 434 421 … … 505 492 { 506 493 unsigned int i; 507 struct dep *d;508 494 509 495 for (i = 0; i < r->num; ++i) … … 515 501 putchar (':'); 516 502 517 for (d = r->deps; d != 0; d = d->next) 518 printf (" %s", dep_name (d)); 519 putchar ('\n'); 503 print_prereqs (r->deps); 520 504 521 505 if (r->cmds != 0) … … 564 548 makefiles and thus count_implicit_rule_limits wasn't called yet. */ 565 549 if (num_pattern_rules != 0) 566 fatal (NILF, _("BUG: num_pattern_rules wrong! %u != %u"),550 fatal (NILF, _("BUG: num_pattern_rules is wrong! %u != %u"), 567 551 num_pattern_rules, rules); 568 552 }
Note:
See TracChangeset
for help on using the changeset viewer.