- Timestamp:
- Nov 3, 2008 1:54:19 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/remake.c
r2024 r2028 66 66 FILE_TIMESTAMP this_mtime, int *must_make_ptr); 67 67 #ifdef CONFIG_WITH_DOT_MUST_MAKE 68 static int call_must_make_target_var (struct file *file); 68 static int call_must_make_target_var (struct file *file, unsigned int depth); 69 #endif 70 #ifdef CONFIG_WITH_DOT_IS_CHANGED 71 static int call_is_changed_target_var (struct file *file); 69 72 #endif 70 73 static int touch_file (struct file *file); … … 622 625 } 623 626 624 #ifdef CONFIG_WITH_DOT_MUST_MAKE625 /* Check with the .MUST_MAKE target variable if it's626 not already decided to make the file. */627 if (!must_make)628 # ifdef CONFIG_WITH_EXPLICIT_MULTITARGET629 must_make = call_must_make_target_var (f2);630 # else631 must_make = call_must_make_target_var (file);632 # endif633 #endif634 635 627 #ifdef CONFIG_WITH_EXPLICIT_MULTITARGET 636 628 if (dep_status != 0 && !keep_going_flag) … … 638 630 } 639 631 #endif 632 633 #ifdef CONFIG_WITH_DOT_MUST_MAKE 634 /* Check with the .MUST_MAKE target variable if it's 635 not already decided to make the file. */ 636 637 # ifdef CONFIG_WITH_EXPLICIT_MULTITARGET 638 if (!must_make) 639 for (f2 = file; f2 && !must_make; f2 = f2->multi_next) 640 must_make = call_must_make_target_var (f2, depth); 641 # else 642 if (!must_make) 643 must_make = call_must_make_target_var (file, depth); 644 # endif 645 #endif /* CONFIG_WITH_DOT_MUST_MAKE */ 640 646 641 647 /* Now we know whether this target needs updating. … … 917 923 undefined in this call. */ 918 924 static int 919 call_must_make_target_var (struct file *file )925 call_must_make_target_var (struct file *file, unsigned int depth) 920 926 { 921 927 struct variable *var; … … 941 947 while (isspace (ch)); 942 948 943 return (ch != '\0'); 949 if (ch != '\0') 950 { 951 if (ISDB (DB_BASIC)) 952 { 953 print_spaces (depth); 954 printf (_(".MUST_MAKE returned `%s' for target `%s'.\n"), 955 str, file->name); 956 } 957 return 1; 958 } 944 959 } 945 960 } … … 947 962 } 948 963 #endif /* CONFIG_WITH_DOT_MUST_MAKE */ 964 #ifdef CONFIG_WITH_DOT_IS_CHANGED 965 966 967 /* Consider the .IS_CHANGED target variable if present. 968 969 Returns 1 if the file should be considered modified, 0 if not. 970 971 The calling context and restrictions are the same as for .MUST_MAKE. 972 Make uses the information from this 'function' for determining whether to 973 make a file which lists this as a prerequisite. So, this is the feature you 974 use to check MD5 sums, file sizes, time stamps and the like with data from 975 a previous run. 976 977 FIXME: Would be nice to know which file is currently being considered. 978 FIXME: Is currently not invoked for intermediate files. */ 979 static int 980 call_is_changed_target_var (struct file *file) 981 { 982 struct variable *var; 983 unsigned char ch; 984 const char *str; 985 986 if (file->variables) 987 { 988 var = lookup_variable_in_set (".IS_CHANGED", sizeof (".IS_CHANGED") - 1, 989 file->variables->set); 990 if (var) 991 { 992 initialize_file_variables (file, 0); 993 set_file_variables (file, 1 /* called early, no dep lists please */); 994 995 str = variable_expand_for_file_2 (NULL, 996 var->value, var->value_length, 997 file, NULL); 998 999 /* stripped string should be non-zero. */ 1000 do 1001 ch = *str++; 1002 while (isspace (ch)); 1003 1004 return (ch != '\0'); 1005 } 1006 } 1007 return 0; 1008 } 1009 #endif /* CONFIG_WITH_DOT_IS_CHANGED */ 949 1010 950 1011 … … 1194 1255 if (mtime == NONEXISTENT_MTIME || mtime > this_mtime) 1195 1256 *must_make_ptr = 1; 1257 #ifdef CONFIG_WITH_DOT_IS_CHANGED 1258 else if ( *must_make_ptr == 0 1259 && call_is_changed_target_var (file)) 1260 *must_make_ptr = 1; 1261 #endif /* CONFIG_WITH_DOT_IS_CHANGED */ 1196 1262 } 1197 1263 else
Note:
See TracChangeset
for help on using the changeset viewer.