| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: parse.c,v 1.591 2021/12/28 15:48:59 rillig Exp $ */ | | 1 | /* $NetBSD: parse.c,v 1.592 2021/12/28 16:11:00 rillig Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 1988, 1989, 1990, 1993 | | 4 | * Copyright (c) 1988, 1989, 1990, 1993 |
5 | * The Regents of the University of California. All rights reserved. | | 5 | * The Regents of the University of California. All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software contributed to Berkeley by | | 7 | * This code is derived from software contributed to Berkeley by |
8 | * Adam de Boor. | | 8 | * Adam de Boor. |
9 | * | | 9 | * |
10 | * Redistribution and use in source and binary forms, with or without | | 10 | * Redistribution and use in source and binary forms, with or without |
11 | * modification, are permitted provided that the following conditions | | 11 | * modification, are permitted provided that the following conditions |
12 | * are met: | | 12 | * are met: |
13 | * 1. Redistributions of source code must retain the above copyright | | 13 | * 1. Redistributions of source code must retain the above copyright |
14 | * notice, this list of conditions and the following disclaimer. | | 14 | * notice, this list of conditions and the following disclaimer. |
| @@ -99,27 +99,27 @@ | | | @@ -99,27 +99,27 @@ |
99 | | | 99 | |
100 | #include <sys/types.h> | | 100 | #include <sys/types.h> |
101 | #include <sys/stat.h> | | 101 | #include <sys/stat.h> |
102 | #include <errno.h> | | 102 | #include <errno.h> |
103 | #include <stdarg.h> | | 103 | #include <stdarg.h> |
104 | #include <stdint.h> | | 104 | #include <stdint.h> |
105 | | | 105 | |
106 | #include "make.h" | | 106 | #include "make.h" |
107 | #include "dir.h" | | 107 | #include "dir.h" |
108 | #include "job.h" | | 108 | #include "job.h" |
109 | #include "pathnames.h" | | 109 | #include "pathnames.h" |
110 | | | 110 | |
111 | /* "@(#)parse.c 8.3 (Berkeley) 3/19/94" */ | | 111 | /* "@(#)parse.c 8.3 (Berkeley) 3/19/94" */ |
112 | MAKE_RCSID("$NetBSD: parse.c,v 1.591 2021/12/28 15:48:59 rillig Exp $"); | | 112 | MAKE_RCSID("$NetBSD: parse.c,v 1.592 2021/12/28 16:11:00 rillig Exp $"); |
113 | | | 113 | |
114 | /* types and constants */ | | 114 | /* types and constants */ |
115 | | | 115 | |
116 | /* | | 116 | /* |
117 | * Structure for a file being read ("included file") | | 117 | * Structure for a file being read ("included file") |
118 | */ | | 118 | */ |
119 | typedef struct IFile { | | 119 | typedef struct IFile { |
120 | FStr name; /* absolute or relative to the cwd */ | | 120 | FStr name; /* absolute or relative to the cwd */ |
121 | bool fromForLoop; /* simulated .include by the .for loop */ | | 121 | bool fromForLoop; /* simulated .include by the .for loop */ |
122 | int lineno; /* current line number in file */ | | 122 | int lineno; /* current line number in file */ |
123 | int first_lineno; /* line number of start of text */ | | 123 | int first_lineno; /* line number of start of text */ |
124 | unsigned int cond_depth; /* 'if' nesting when file opened */ | | 124 | unsigned int cond_depth; /* 'if' nesting when file opened */ |
125 | bool depending; /* state of doing_depend on EOF */ | | 125 | bool depending; /* state of doing_depend on EOF */ |
| @@ -890,28 +890,27 @@ ParseDependencySourceOrder(const char *s | | | @@ -890,28 +890,27 @@ ParseDependencySourceOrder(const char *s |
890 | GNode *gn; | | 890 | GNode *gn; |
891 | /* | | 891 | /* |
892 | * Create proper predecessor/successor links between the previous | | 892 | * Create proper predecessor/successor links between the previous |
893 | * source and the current one. | | 893 | * source and the current one. |
894 | */ | | 894 | */ |
895 | gn = Targ_GetNode(src); | | 895 | gn = Targ_GetNode(src); |
896 | if (doing_depend) | | 896 | if (doing_depend) |
897 | RememberLocation(gn); | | 897 | RememberLocation(gn); |
898 | if (order_pred != NULL) { | | 898 | if (order_pred != NULL) { |
899 | Lst_Append(&order_pred->order_succ, gn); | | 899 | Lst_Append(&order_pred->order_succ, gn); |
900 | Lst_Append(&gn->order_pred, order_pred); | | 900 | Lst_Append(&gn->order_pred, order_pred); |
901 | if (DEBUG(PARSE)) { | | 901 | if (DEBUG(PARSE)) { |
902 | debug_printf( | | 902 | debug_printf( |
903 | "# ParseDependencySourceOrder: " | | 903 | "# .ORDER forces '%s' to be made before '%s'\n", |
904 | "added Order dependency %s - %s\n", | | | |
905 | order_pred->name, gn->name); | | 904 | order_pred->name, gn->name); |
906 | Targ_PrintNode(order_pred, 0); | | 905 | Targ_PrintNode(order_pred, 0); |
907 | Targ_PrintNode(gn, 0); | | 906 | Targ_PrintNode(gn, 0); |
908 | } | | 907 | } |
909 | } | | 908 | } |
910 | /* | | 909 | /* |
911 | * The current source now becomes the predecessor for the next one. | | 910 | * The current source now becomes the predecessor for the next one. |
912 | */ | | 911 | */ |
913 | order_pred = gn; | | 912 | order_pred = gn; |
914 | } | | 913 | } |
915 | | | 914 | |
916 | static void | | 915 | static void |
917 | ParseDependencySourceOther(const char *src, GNodeType targetAttr, | | 916 | ParseDependencySourceOther(const char *src, GNodeType targetAttr, |