| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: parse.c,v 1.414 2020/10/31 09:47:27 rillig Exp $ */ | | 1 | /* $NetBSD: parse.c,v 1.415 2020/10/31 21:52:56 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. |
| @@ -107,27 +107,27 @@ | | | @@ -107,27 +107,27 @@ |
107 | #ifndef MAP_FILE | | 107 | #ifndef MAP_FILE |
108 | #define MAP_FILE 0 | | 108 | #define MAP_FILE 0 |
109 | #endif | | 109 | #endif |
110 | #ifndef MAP_COPY | | 110 | #ifndef MAP_COPY |
111 | #define MAP_COPY MAP_PRIVATE | | 111 | #define MAP_COPY MAP_PRIVATE |
112 | #endif | | 112 | #endif |
113 | | | 113 | |
114 | #include "make.h" | | 114 | #include "make.h" |
115 | #include "dir.h" | | 115 | #include "dir.h" |
116 | #include "job.h" | | 116 | #include "job.h" |
117 | #include "pathnames.h" | | 117 | #include "pathnames.h" |
118 | | | 118 | |
119 | /* "@(#)parse.c 8.3 (Berkeley) 3/19/94" */ | | 119 | /* "@(#)parse.c 8.3 (Berkeley) 3/19/94" */ |
120 | MAKE_RCSID("$NetBSD: parse.c,v 1.414 2020/10/31 09:47:27 rillig Exp $"); | | 120 | MAKE_RCSID("$NetBSD: parse.c,v 1.415 2020/10/31 21:52:56 rillig Exp $"); |
121 | | | 121 | |
122 | /* types and constants */ | | 122 | /* types and constants */ |
123 | | | 123 | |
124 | /* | | 124 | /* |
125 | * Structure for a file being read ("included file") | | 125 | * Structure for a file being read ("included file") |
126 | */ | | 126 | */ |
127 | typedef struct IFile { | | 127 | typedef struct IFile { |
128 | char *fname; /* name of file */ | | 128 | char *fname; /* name of file */ |
129 | Boolean fromForLoop; /* simulated .include by the .for loop */ | | 129 | Boolean fromForLoop; /* simulated .include by the .for loop */ |
130 | int lineno; /* current line number in file */ | | 130 | int lineno; /* current line number in file */ |
131 | int first_lineno; /* line number of start of text */ | | 131 | int first_lineno; /* line number of start of text */ |
132 | unsigned int cond_depth; /* 'if' nesting when file opened */ | | 132 | unsigned int cond_depth; /* 'if' nesting when file opened */ |
133 | Boolean depending; /* state of doing_depend on EOF */ | | 133 | Boolean depending; /* state of doing_depend on EOF */ |
| @@ -186,29 +186,29 @@ typedef enum ParseSpecial { | | | @@ -186,29 +186,29 @@ typedef enum ParseSpecial { |
186 | typedef List SearchPathList; | | 186 | typedef List SearchPathList; |
187 | typedef ListNode SearchPathListNode; | | 187 | typedef ListNode SearchPathListNode; |
188 | | | 188 | |
189 | /* result data */ | | 189 | /* result data */ |
190 | | | 190 | |
191 | /* | | 191 | /* |
192 | * The main target to create. This is the first target on the first | | 192 | * The main target to create. This is the first target on the first |
193 | * dependency line in the first makefile. | | 193 | * dependency line in the first makefile. |
194 | */ | | 194 | */ |
195 | static GNode *mainNode; | | 195 | static GNode *mainNode; |
196 | | | 196 | |
197 | /* eval state */ | | 197 | /* eval state */ |
198 | | | 198 | |
199 | /* During parsing, the targets from the currently active dependency line, | | 199 | /* During parsing, the targets from the left-hand side of the currently |
200 | * or NULL if the current line does not belong to a dependency line, for | | 200 | * active dependency line, or NULL if the current line does not belong to a |
201 | * example because it is a variable assignment. | | 201 | * dependency line, for example because it is a variable assignment. |
202 | * | | 202 | * |
203 | * See unit-tests/deptgt.mk, keyword "parse.c:targets". */ | | 203 | * See unit-tests/deptgt.mk, keyword "parse.c:targets". */ |
204 | static GNodeList *targets; | | 204 | static GNodeList *targets; |
205 | | | 205 | |
206 | #ifdef CLEANUP | | 206 | #ifdef CLEANUP |
207 | /* All shell commands for all targets, in no particular order and possibly | | 207 | /* All shell commands for all targets, in no particular order and possibly |
208 | * with duplicates. Kept in a separate list since the commands from .USE or | | 208 | * with duplicates. Kept in a separate list since the commands from .USE or |
209 | * .USEBEFORE nodes are shared with other GNodes, thereby giving up the | | 209 | * .USEBEFORE nodes are shared with other GNodes, thereby giving up the |
210 | * easily understandable ownership over the allocated strings. */ | | 210 | * easily understandable ownership over the allocated strings. */ |
211 | static StringList *targCmds; | | 211 | static StringList *targCmds; |
212 | #endif | | 212 | #endif |
213 | | | 213 | |
214 | /* | | 214 | /* |