- Timestamp:
- Nov 2, 2008 5:43:17 AM (16 years ago)
- Location:
- trunk/src/kmk
- Files:
-
- 1 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/Makefile.am
r2010 r2024 108 108 -DCONFIG_WITH_DEFINED \ 109 109 -DCONFIG_WITH_EXPLICIT_MULTITARGET \ 110 -DCONFIG_WITH_DOT_MUST_MAKE \ 110 111 -DCONFIG_WITH_PREPEND_ASSIGNMENT \ 111 112 -DCONFIG_WITH_LOCAL_VARIABLES \ -
trunk/src/kmk/Makefile.kmk
r2019 r2024 136 136 CONFIG_WITH_DEFINED \ 137 137 CONFIG_WITH_EXPLICIT_MULTITARGET \ 138 CONFIG_WITH_DOT_MUST_MAKE \ 138 139 CONFIG_WITH_PREPEND_ASSIGNMENT \ 139 140 CONFIG_WITH_LOCAL_VARIABLES \ -
trunk/src/kmk/commands.c
r1993 r2024 47 47 48 48 void 49 #if defined(CONFIG_WITH_COMMANDS_FUNC) || defined (CONFIG_WITH_DOT_MUST_MAKE) 50 set_file_variables (struct file *file, int called_early) 51 #else 49 52 set_file_variables (struct file *file) 53 #endif 50 54 { 51 55 const struct dep *d; … … 182 186 DEFINE_VARIABLE ("%", 1, percent); 183 187 #endif /* CONFIG_WITH_RDONLY_VARIABLE_VALUE */ 188 189 #if defined(CONFIG_WITH_COMMANDS_FUNC) || defined (CONFIG_WITH_DOT_MUST_MAKE) 190 /* The $^, $+, $? and $| variables should not be set if we're called 191 early by a .MUST_MAKE invocation or $(commands ). */ 192 if (called_early) 193 return; 194 #endif 184 195 185 196 /* Compute the values for $^, $+, $?, and $|. */ … … 500 511 initialize_file_variables (file, 0); 501 512 513 #if defined(CONFIG_WITH_COMMANDS_FUNC) || defined (CONFIG_WITH_DOT_MUST_MAKE) 514 set_file_variables (file, 0 /* final call */); 515 #else 502 516 set_file_variables (file); 517 #endif 503 518 504 519 /* Start the commands running. */ -
trunk/src/kmk/commands.h
r1993 r2024 42 42 # define COMMANDS_NOTPARALLEL 32 /* kmk: The commands must be executed alone. */ 43 43 # define COMMANDS_NO_COMMANDS 64 /* kmk: No commands. */ 44 #endif 44 #endif 45 45 #ifdef CONFIG_WITH_KMK_BUILTIN 46 46 # define COMMANDS_KMK_BUILTIN 128 /* kmk: kmk builtin command. */ … … 54 54 void delete_child_targets (struct child *child); 55 55 void chop_commands (struct commands *cmds); 56 #if defined(CONFIG_WITH_COMMANDS_FUNC) || defined (CONFIG_WITH_DOT_MUST_MAKE) 57 void set_file_variables (struct file *file, int called_early); 58 #else 56 59 void set_file_variables (struct file *file); 60 #endif -
trunk/src/kmk/file.c
r1993 r2024 666 666 f->stem = d->stem; 667 667 668 #if defined(CONFIG_WITH_COMMANDS_FUNC) || defined (CONFIG_WITH_DOT_MUST_MAKE) 669 set_file_variables (f, 0 /* real call, f->deps == 0 so we're ok. */); 670 #else 668 671 set_file_variables (f); 672 #endif 669 673 670 674 #if !defined (CONFIG_WITH_VALUE_LENGTH) || !defined (CONFIG_WITH_STRCACHE2) -
trunk/src/kmk/function.c
r2021 r2024 4365 4365 } 4366 4366 4367 initialize_file_variables (file, 1 /* reading - FIXME: we don't know?*/);4368 set_file_variables (file ); /* FIXME: this must *NOT* be done twice! */4367 initialize_file_variables (file, 1 /* don't search for pattern vars */); 4368 set_file_variables (file, 1 /* early call */); 4369 4369 chop_commands (cmds); 4370 4370 -
trunk/src/kmk/implicit.c
r2001 r2024 561 561 if (!file_variables_set) 562 562 { 563 #if defined(CONFIG_WITH_COMMANDS_FUNC) || defined (CONFIG_WITH_DOT_MUST_MAKE) 564 set_file_variables (file, 0 /* real call */); 565 #else 563 566 set_file_variables (file); 567 #endif 564 568 file_variables_set = 1; 565 569 } -
trunk/src/kmk/remake.c
r2001 r2024 65 65 static int check_dep (struct file *file, unsigned int depth, 66 66 FILE_TIMESTAMP this_mtime, int *must_make_ptr); 67 #ifdef CONFIG_WITH_DOT_MUST_MAKE 68 static int call_must_make_target_var (struct file *file); 69 #endif 67 70 static int touch_file (struct file *file); 68 71 static void remake_file (struct file *file); … … 511 514 and see whether any of them is more recent than this file. 512 515 For explicit multitarget rules we must iterate all the output 513 files to get the correct picture. */ 516 files to get the correct picture. The special .MUST_MAKE 517 target variable call is also done from this context. */ 514 518 515 519 #ifdef CONFIG_WITH_EXPLICIT_MULTITARGET … … 617 621 d = d->next; 618 622 } 623 624 #ifdef CONFIG_WITH_DOT_MUST_MAKE 625 /* Check with the .MUST_MAKE target variable if it's 626 not already decided to make the file. */ 627 if (!must_make) 628 # ifdef CONFIG_WITH_EXPLICIT_MULTITARGET 629 must_make = call_must_make_target_var (f2); 630 # else 631 must_make = call_must_make_target_var (file); 632 # endif 633 #endif 634 619 635 #ifdef CONFIG_WITH_EXPLICIT_MULTITARGET 620 636 if (dep_status != 0 && !keep_going_flag) … … 884 900 return file->update_status; 885 901 } 902 #ifdef CONFIG_WITH_DOT_MUST_MAKE 903 904 905 /* Consider the .MUST_MAKE target variable if present. 906 907 Returns 1 if must remake, 0 if not. 908 909 The deal is that .MUST_MAKE returns non-zero if it thinks the target needs 910 updating. We have to initialize file variables (for the sake of pattern 911 vars) and set the most important file variables before calling (expanding) 912 the .MUST_MAKE variable. 913 914 The file variables keeping the dependency lists, $+, $^, $? and $| are not 915 available at this point because $? depends on things happening after we've 916 decided to make the file. So, to keep things simple all 4 of them are 917 undefined in this call. */ 918 static int 919 call_must_make_target_var (struct file *file) 920 { 921 struct variable *var; 922 unsigned char ch; 923 const char *str; 924 925 if (file->variables) 926 { 927 var = lookup_variable_in_set (".MUST_MAKE", sizeof (".MUST_MAKE") - 1, 928 file->variables->set); 929 if (var) 930 { 931 initialize_file_variables (file, 0); 932 set_file_variables (file, 1 /* called early, no dep lists please */); 933 934 str = variable_expand_for_file_2 (NULL, 935 var->value, var->value_length, 936 file, NULL); 937 938 /* stripped string should be non-zero. */ 939 do 940 ch = *str++; 941 while (isspace (ch)); 942 943 return (ch != '\0'); 944 } 945 } 946 return 0; 947 } 948 #endif /* CONFIG_WITH_DOT_MUST_MAKE */ 886 949 887 950 -
trunk/src/kmk/variable.c
r2021 r2024 1196 1196 && defined (CONFIG_WITH_XARGS) \ 1197 1197 && defined (CONFIG_WITH_EXPLICIT_MULTITARGET) \ 1198 && defined (CONFIG_WITH_DOT_MUST_MAKE) \ 1198 1199 && defined (CONFIG_WITH_PREPEND_ASSIGNMENT) \ 1199 1200 && defined (CONFIG_WITH_SET_CONDITIONALS) \ … … 1216 1217 " xargs" 1217 1218 " explicit-multitarget" 1219 " dot-must-make" 1218 1220 " prepend-assignment" 1219 1221 " set-conditionals intersects" … … 1256 1258 # if defined (CONFIG_WITH_EXPLICIT_MULTITARGET) 1257 1259 strcat (buf, " explicit-multitarget"); 1260 # endif 1261 # if defined (CONFIG_WITH_DOT_MUST_MAKE) 1262 strcat (buf, " dot-must-make"); 1258 1263 # endif 1259 1264 # if defined (CONFIG_WITH_PREPEND_ASSIGNMENT)
Note:
See TracChangeset
for help on using the changeset viewer.