569 {
570 register int i;
571 register Property line;
572 Name name;
573 Name directory;
574 wchar_t *namep;
575 char *mb_namep;
576 Dependency dp;
577 Dependency *dpp;
578 Property line2;
579 wchar_t relative[MAXPATHLEN];
580 register int recursive_state;
581 Boolean register_as_auto;
582 Boolean not_auto_found;
583 char *slash;
584 Wstring depstr;
585
586 /* Check if this is a .RECURSIVE line */
587 if ((depes->used >= 3) &&
588 (depes->names[0] == recursive_name)) {
589 #ifdef NSE
590 nse_did_recursion= true;
591 #endif
592 target->has_recursive_dependency = true;
593 depes->names[0] = NULL;
594 recursive_state = 0;
595 dp = NULL;
596 dpp = &dp;
597 /* Read the dependencies. They are "<directory> <target-made>*/
598 /* <makefile>*" */
599 for (; depes != NULL; depes = depes->next) {
600 for (i = 0; i < depes->used; i++) {
601 if (depes->names[i] != NULL) {
602 switch (recursive_state++) {
603 case 0: /* Directory */
604 {
605 depstr.init(depes->names[i]);
606 make_relative(depstr.get_string(),
607 relative);
608 directory =
609 GETNAME(relative,
610 FIND_LENGTH);
611 }
869 */
870 void
871 enter_dependency(Property line, register Name depe, Boolean automatic)
872 {
873 register Dependency dp;
874 register Dependency *insert;
875
876 if (trace_reader) {
877 (void) printf("%s ", depe->string_mb);
878 }
879 /* Find the end of the list and check for duplicates */
880 for (insert = &line->body.line.dependencies, dp = *insert;
881 dp != NULL;
882 insert = &dp->next, dp = *insert) {
883 if ((dp->name == depe) && (depe != wait_name)) {
884 if (dp->automatic) {
885 dp->automatic = automatic;
886 if (automatic) {
887 dp->built = false;
888 depe->stat.is_file = true;
889 #ifdef NSE
890 depe->has_parent= true;
891 depe->is_target= true;
892 #endif
893 }
894 }
895 dp->stale = false;
896 return;
897 }
898 }
899 /* Insert the new dependency since we couldnt find it */
900 dp = *insert = ALLOC(Dependency);
901 dp->name = depe;
902 dp->next = NULL;
903 dp->automatic = automatic;
904 dp->stale = false;
905 dp->built = false;
906 depe->stat.is_file = true;
907 #ifdef NSE
908 depe->has_parent= true;
909 depe->is_target= true;
910 #endif
911
912 if ((makefile_type == reading_makefile) &&
913 (line != NULL) &&
914 (line->body.line.target != NULL)) {
915 line->body.line.target->has_regular_dependency = true;
916 #ifdef NSE
917 line->body.line.target->is_target= true;
918 #endif
919 }
920 }
921
922 /*
923 * enter_percent(target, depes, command)
924 *
925 * Enter "x%y : a%b" type lines
926 * % patterns are stored in four parts head and tail for target and source
927 *
928 * Parameters:
929 * target Left hand side of pattern
930 * depes The dependency list with the rh pattern
931 * command The command for the pattern
932 *
933 * Global variables used:
934 * empty_name The Name "", compared against
935 * percent_list The list of all percent rules, added to
936 * trace_reader Indicates that we should echo stuff we read
937 */
938 Percent
1180 }
1181 break;
1182
1183 case built_last_make_run_special:
1184 built_last_make_run_seen = true;
1185 break;
1186
1187 case default_special:
1188 if (depes->used != 0) {
1189 warning(catgets(catd, 1, 100, "Illegal dependency list for target `%s'"),
1190 target->string_mb);
1191 }
1192 default_rule = command;
1193 if (trace_reader) {
1194 (void) printf("%s:\n",
1195 default_rule_name->string_mb);
1196 print_rule(command);
1197 }
1198 break;
1199
1200 #ifdef NSE
1201 case derived_src_special:
1202 for (; depes != NULL; depes= depes->next)
1203 for (n= 0; n < depes->used; n++) {
1204 if (trace_reader)
1205 (void)printf("%s:\t%s\n",
1206 precious->string_mb,
1207 depes->names[n]->string_mb);
1208 depes->names[n]->stat.is_derived_src= true;
1209 };
1210 break;
1211 #endif
1212
1213 case ignore_special:
1214 if ((depes->used != 0) &&(!posix)){
1215 fatal_reader(catgets(catd, 1, 101, "Illegal dependencies for target `%s'"),
1216 target->string_mb);
1217 }
1218 if (depes->used == 0)
1219 {
1220 ignore_errors_all = true;
1221 }
1222 if(svr4) {
1223 ignore_errors_all = true;
1224 break;
1225 }
1226 for (; depes != NULL; depes = depes->next) {
1227 for (n = 0; n < depes->used; n++) {
1228 depes->names[n]->ignore_error_mode = true;
1229 }
1230 }
1231 if (trace_reader) {
|
569 {
570 register int i;
571 register Property line;
572 Name name;
573 Name directory;
574 wchar_t *namep;
575 char *mb_namep;
576 Dependency dp;
577 Dependency *dpp;
578 Property line2;
579 wchar_t relative[MAXPATHLEN];
580 register int recursive_state;
581 Boolean register_as_auto;
582 Boolean not_auto_found;
583 char *slash;
584 Wstring depstr;
585
586 /* Check if this is a .RECURSIVE line */
587 if ((depes->used >= 3) &&
588 (depes->names[0] == recursive_name)) {
589 target->has_recursive_dependency = true;
590 depes->names[0] = NULL;
591 recursive_state = 0;
592 dp = NULL;
593 dpp = &dp;
594 /* Read the dependencies. They are "<directory> <target-made>*/
595 /* <makefile>*" */
596 for (; depes != NULL; depes = depes->next) {
597 for (i = 0; i < depes->used; i++) {
598 if (depes->names[i] != NULL) {
599 switch (recursive_state++) {
600 case 0: /* Directory */
601 {
602 depstr.init(depes->names[i]);
603 make_relative(depstr.get_string(),
604 relative);
605 directory =
606 GETNAME(relative,
607 FIND_LENGTH);
608 }
866 */
867 void
868 enter_dependency(Property line, register Name depe, Boolean automatic)
869 {
870 register Dependency dp;
871 register Dependency *insert;
872
873 if (trace_reader) {
874 (void) printf("%s ", depe->string_mb);
875 }
876 /* Find the end of the list and check for duplicates */
877 for (insert = &line->body.line.dependencies, dp = *insert;
878 dp != NULL;
879 insert = &dp->next, dp = *insert) {
880 if ((dp->name == depe) && (depe != wait_name)) {
881 if (dp->automatic) {
882 dp->automatic = automatic;
883 if (automatic) {
884 dp->built = false;
885 depe->stat.is_file = true;
886 }
887 }
888 dp->stale = false;
889 return;
890 }
891 }
892 /* Insert the new dependency since we couldnt find it */
893 dp = *insert = ALLOC(Dependency);
894 dp->name = depe;
895 dp->next = NULL;
896 dp->automatic = automatic;
897 dp->stale = false;
898 dp->built = false;
899 depe->stat.is_file = true;
900
901 if ((makefile_type == reading_makefile) &&
902 (line != NULL) &&
903 (line->body.line.target != NULL)) {
904 line->body.line.target->has_regular_dependency = true;
905 }
906 }
907
908 /*
909 * enter_percent(target, depes, command)
910 *
911 * Enter "x%y : a%b" type lines
912 * % patterns are stored in four parts head and tail for target and source
913 *
914 * Parameters:
915 * target Left hand side of pattern
916 * depes The dependency list with the rh pattern
917 * command The command for the pattern
918 *
919 * Global variables used:
920 * empty_name The Name "", compared against
921 * percent_list The list of all percent rules, added to
922 * trace_reader Indicates that we should echo stuff we read
923 */
924 Percent
1166 }
1167 break;
1168
1169 case built_last_make_run_special:
1170 built_last_make_run_seen = true;
1171 break;
1172
1173 case default_special:
1174 if (depes->used != 0) {
1175 warning(catgets(catd, 1, 100, "Illegal dependency list for target `%s'"),
1176 target->string_mb);
1177 }
1178 default_rule = command;
1179 if (trace_reader) {
1180 (void) printf("%s:\n",
1181 default_rule_name->string_mb);
1182 print_rule(command);
1183 }
1184 break;
1185
1186
1187 case ignore_special:
1188 if ((depes->used != 0) &&(!posix)){
1189 fatal_reader(catgets(catd, 1, 101, "Illegal dependencies for target `%s'"),
1190 target->string_mb);
1191 }
1192 if (depes->used == 0)
1193 {
1194 ignore_errors_all = true;
1195 }
1196 if(svr4) {
1197 ignore_errors_all = true;
1198 break;
1199 }
1200 for (; depes != NULL; depes = depes->next) {
1201 for (n = 0; n < depes->used; n++) {
1202 depes->names[n]->ignore_error_mode = true;
1203 }
1204 }
1205 if (trace_reader) {
|