Changeset 2594 in kBuild
- Timestamp:
- Jun 17, 2012 11:29:07 PM (13 years ago)
- Location:
- trunk/src/kmk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/commands.c
r2591 r2594 116 116 117 117 #endif /* CONFIG_WITH_STRCACHE2 */ 118 119 #ifdef CONFIG_WITH_LAZY_DEPS_VARS 120 /* Create as copy of DEPS without duplicates, similar to what 121 set_file_variables does. Used by func_deps. */ 122 123 struct dep *create_uniqute_deps_chain (struct dep *deps) 124 { 125 struct dep *d; 126 struct dep *head = NULL; 127 struct dep **ppnext= &head; 128 struct hash_table dep_hash; 129 void **slot; 130 131 hash_init (&dep_hash, 500, dep_hash_1, dep_hash_2, dep_hash_cmp); 132 133 for (d = deps; d != 0; d = d->next) 134 { 135 if (d->need_2nd_expansion) 136 continue; 137 138 slot = hash_find_slot (&dep_hash, d); 139 if (HASH_VACANT (*slot)) 140 { 141 struct dep *n = alloc_dep(); 142 *n = *d; 143 n->next = NULL; 144 *ppnext = n; 145 ppnext = &n->next; 146 hash_insert_at (&dep_hash, n, slot); 147 } 148 else 149 { 150 /* Upgrade order only if a normal dep exists. 151 Note! Elected not to upgrade the original, only the sanitized 152 list, need to check that out later. FIXME TODO */ 153 struct dep *d2 = (struct dep *)*slot; 154 if (d->ignore_mtime != d2->ignore_mtime) 155 d->ignore_mtime = d2->ignore_mtime = 0; 156 } 157 } 158 159 return head; 160 } 161 #endif /* CONFIG_WITH_LAZY_DEPS_VARS */ 118 162 119 163 /* Set FILE's automatic variables up. */ … … 451 495 DEFINE_VARIABLE ("|", 1, bar_value); 452 496 } 453 #ifdef CONFIG_WITH_LAZY_DEPS_VARS454 else455 {456 /* Make a copy of the current dependency chain for later use in457 potential $(dep-pluss $@) calls. Then drop duplicate deps. */458 459 /* assert (file->org_deps == NULL); - FIXME? */460 free_dep_chain (file->org_deps);461 file->org_deps = copy_dep_chain (file->deps);462 463 /** @todo do uniquize_deps (file->deps); in the $(dep-* ) functions, it'll464 * save even more space that way. */465 }466 #endif /* CONFIG_WITH_LAZY_DEPS_VARS */467 497 #undef DEFINE_VARIABLE 468 498 } -
trunk/src/kmk/commands.h
r2591 r2594 62 62 void set_file_variables (struct file *file); 63 63 #endif 64 #ifdef CONFIG_WITH_LAZY_DEPS_VARS 65 struct dep *create_uniqute_deps_chain (struct dep *deps); 66 #endif 67 -
trunk/src/kmk/filedef.h
r2591 r2594 31 31 struct dep *deps; /* all dependencies, including duplicates */ 32 32 #ifdef CONFIG_WITH_LAZY_DEPS_VARS 33 struct dep * org_deps; /* original dependencies before34 d uplicates were dropped. */33 struct dep *deps_no_dupes; /* dependencies without duplicates, created on 34 demaned by func_deps. */ 35 35 #endif 36 36 struct commands *cmds; /* Commands to execute for this target. */ -
trunk/src/kmk/function.c
r2592 r2594 3004 3004 /* Implements $^ and $+. 3005 3005 3006 The first is somes withwith FUNCNAME 'deps', the second as 'deps-all'.3006 The first comes with FUNCNAME 'deps', the second as 'deps-all'. 3007 3007 3008 3008 If no second argument is given, or if it's empty, or if it's zero, … … 3040 3040 if (file) 3041 3041 { 3042 struct dep *deps = funcname[4] != '\0' && file->org_deps 3043 ? file->org_deps : file->deps; 3042 struct dep *deps; 3044 3043 struct dep *d; 3044 if (funcname[4] == '\0') 3045 { 3046 deps = file->deps_no_dupes; 3047 if (!deps && file->deps) 3048 deps = file->deps = create_uniqute_deps_chain (file->deps); 3049 } 3050 else 3051 deps = file->deps; 3045 3052 3046 3053 if ( file->double_colon
Note:
See TracChangeset
for help on using the changeset viewer.