Changeset 1932 for trunk/src/kmk/commands.c
- Timestamp:
- Oct 24, 2008, 10:22:22 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/commands.c
r1898 r1932 85 85 const char *name; 86 86 unsigned int len; 87 #ifdef CONFIG_WITH_STRCACHE2 88 static const char *suffixes_strcache = 0; /* XXX: make this global */ 89 90 if (!suffixes_strcache) 91 suffixes_strcache = strcache_add_len (".SUFFIXES", sizeof (".SUFFIXES") - 1); 92 #endif /* CONFIG_WITH_STRCACHE2 */ 87 93 88 94 #ifndef NO_ARCHIVES … … 103 109 } 104 110 111 #ifndef CONFIG_WITH_STRCACHE2 105 112 for (d = enter_file (strcache_add (".SUFFIXES"))->deps; d ; d = d->next) 106 113 { 107 #ifndef CONFIG_WITH_STRCACHE2108 114 unsigned int slen = strlen (dep_name (d)); 109 115 #else 116 for (d = enter_file (suffixes_strcache)->deps; d ; d = d->next) 117 { 110 118 unsigned int slen = strcache2_get_len (&file_strcache, dep_name (d)); 111 119 #endif … … 140 148 /* Define the variables. */ 141 149 150 #ifndef CONFIG_WITH_RDONLY_VARIABLE_VALUE 142 151 DEFINE_VARIABLE ("<", 1, less); 143 152 DEFINE_VARIABLE ("*", 1, star); 144 153 DEFINE_VARIABLE ("@", 1, at); 145 154 DEFINE_VARIABLE ("%", 1, percent); 155 #else /* CONFIG_WITH_RDONLY_VARIABLE_VALUE */ 156 # define DEFINE_VARIABLE_RO_VAL(name, len, value, value_len) \ 157 define_variable_in_set((name), (len), (value), (value_len), -1, \ 158 (o_automatic), 0, (file)->variables->set, NILF) 159 160 if (*less == '\0') 161 DEFINE_VARIABLE_RO_VAL ("<", 1, "", 0); 162 else if (less != at || at == file->name) 163 DEFINE_VARIABLE_RO_VAL ("<", 1, less, strcache_get_len (less)); 164 else 165 DEFINE_VARIABLE ("<", 1, less); 166 167 if (*star == '\0') 168 DEFINE_VARIABLE_RO_VAL ("*", 1, "", 0); 169 else 170 DEFINE_VARIABLE_RO_VAL ("*", 1, star, strcache_get_len (star)); 171 172 if (at == file->name) 173 DEFINE_VARIABLE_RO_VAL ("@", 1, at, strcache_get_len (at)); 174 else 175 DEFINE_VARIABLE ("@", 1, at); 176 177 if (*percent == '\0') 178 DEFINE_VARIABLE_RO_VAL ("%", 1, "", 0); 179 else 180 DEFINE_VARIABLE ("%", 1, percent); 181 #endif /* CONFIG_WITH_RDONLY_VARIABLE_VALUE */ 146 182 147 183 /* Compute the values for $^, $+, $?, and $|. */
Note:
See TracChangeset
for help on using the changeset viewer.