make(1): move declaration of parseIncPath from main.c to make.hdiff -r1.424 -r1.425 src/usr.bin/make/main.c
(rillig)
--- src/usr.bin/make/main.c 2020/11/04 13:22:15 1.424
+++ src/usr.bin/make/main.c 2020/11/04 13:29:42 1.425
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: main.c,v 1.424 2020/11/04 13:22:15 rillig Exp $ */ | 1 | /* $NetBSD: main.c,v 1.425 2020/11/04 13:29:42 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. | |
@@ -108,27 +108,27 @@ | @@ -108,27 +108,27 @@ | |||
108 | 108 | |||
109 | #include <errno.h> | 109 | #include <errno.h> | |
110 | #include <signal.h> | 110 | #include <signal.h> | |
111 | #include <stdarg.h> | 111 | #include <stdarg.h> | |
112 | #include <time.h> | 112 | #include <time.h> | |
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 | #include "trace.h" | 118 | #include "trace.h" | |
119 | 119 | |||
120 | /* "@(#)main.c 8.3 (Berkeley) 3/19/94" */ | 120 | /* "@(#)main.c 8.3 (Berkeley) 3/19/94" */ | |
121 | MAKE_RCSID("$NetBSD: main.c,v 1.424 2020/11/04 13:22:15 rillig Exp $"); | 121 | MAKE_RCSID("$NetBSD: main.c,v 1.425 2020/11/04 13:29:42 rillig Exp $"); | |
122 | #if defined(MAKE_NATIVE) && !defined(lint) | 122 | #if defined(MAKE_NATIVE) && !defined(lint) | |
123 | __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 " | 123 | __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 " | |
124 | "The Regents of the University of California. " | 124 | "The Regents of the University of California. " | |
125 | "All rights reserved."); | 125 | "All rights reserved."); | |
126 | #endif | 126 | #endif | |
127 | 127 | |||
128 | #ifndef DEFMAXLOCAL | 128 | #ifndef DEFMAXLOCAL | |
129 | #define DEFMAXLOCAL DEFMAXJOBS | 129 | #define DEFMAXLOCAL DEFMAXJOBS | |
130 | #endif | 130 | #endif | |
131 | 131 | |||
132 | CmdOpts opts; | 132 | CmdOpts opts; | |
133 | time_t now; /* Time at start of make */ | 133 | time_t now; /* Time at start of make */ | |
134 | GNode *DEFAULT; /* .DEFAULT node */ | 134 | GNode *DEFAULT; /* .DEFAULT node */ | |
@@ -148,28 +148,26 @@ static void usage(void) MAKE_ATTR_DEAD; | @@ -148,28 +148,26 @@ static void usage(void) MAKE_ATTR_DEAD; | |||
148 | static void purge_cached_realpaths(void); | 148 | static void purge_cached_realpaths(void); | |
149 | 149 | |||
150 | static Boolean ignorePWD; /* if we use -C, PWD is meaningless */ | 150 | static Boolean ignorePWD; /* if we use -C, PWD is meaningless */ | |
151 | static char objdir[MAXPATHLEN + 1]; /* where we chdir'ed to */ | 151 | static char objdir[MAXPATHLEN + 1]; /* where we chdir'ed to */ | |
152 | char curdir[MAXPATHLEN + 1]; /* Startup directory */ | 152 | char curdir[MAXPATHLEN + 1]; /* Startup directory */ | |
153 | char *progname; /* the program name */ | 153 | char *progname; /* the program name */ | |
154 | char *makeDependfile; | 154 | char *makeDependfile; | |
155 | pid_t myPid; | 155 | pid_t myPid; | |
156 | int makelevel; | 156 | int makelevel; | |
157 | 157 | |||
158 | Boolean forceJobs = FALSE; | 158 | Boolean forceJobs = FALSE; | |
159 | static int errors = 0; | 159 | static int errors = 0; | |
160 | 160 | |||
161 | extern SearchPath *parseIncPath; | |||
162 | ||||
163 | /* | 161 | /* | |
164 | * For compatibility with the POSIX version of MAKEFLAGS that includes | 162 | * For compatibility with the POSIX version of MAKEFLAGS that includes | |
165 | * all the options with out -, convert flags to -f -l -a -g -s. | 163 | * all the options with out -, convert flags to -f -l -a -g -s. | |
166 | */ | 164 | */ | |
167 | static char * | 165 | static char * | |
168 | explode(const char *flags) | 166 | explode(const char *flags) | |
169 | { | 167 | { | |
170 | size_t len; | 168 | size_t len; | |
171 | char *nf, *st; | 169 | char *nf, *st; | |
172 | const char *f; | 170 | const char *f; | |
173 | 171 | |||
174 | if (flags == NULL) | 172 | if (flags == NULL) | |
175 | return NULL; | 173 | return NULL; |
--- src/usr.bin/make/make.h 2020/11/04 13:22:15 1.185
+++ src/usr.bin/make/make.h 2020/11/04 13:29:42 1.186
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: make.h,v 1.185 2020/11/04 13:22:15 rillig Exp $ */ | 1 | /* $NetBSD: make.h,v 1.186 2020/11/04 13:29:42 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. | |
@@ -442,28 +442,33 @@ extern time_t now; /* The time at the s | @@ -442,28 +442,33 @@ extern time_t now; /* The time at the s | |||
442 | * expression are discarded. If TRUE (only during variable assignments using | 442 | * expression are discarded. If TRUE (only during variable assignments using | |
443 | * the ':=' assignment operator, in the top-level expansion), they are | 443 | * the ':=' assignment operator, in the top-level expansion), they are | |
444 | * preserved and possibly expanded later when the variable from the | 444 | * preserved and possibly expanded later when the variable from the | |
445 | * subexpression has been defined. | 445 | * subexpression has been defined. | |
446 | * | 446 | * | |
447 | * Example for a ':=' assignment: | 447 | * Example for a ':=' assignment: | |
448 | * CFLAGS = $(.INCLUDES) | 448 | * CFLAGS = $(.INCLUDES) | |
449 | * CFLAGS := -I.. $(CFLAGS) | 449 | * CFLAGS := -I.. $(CFLAGS) | |
450 | * # If .INCLUDES (an undocumented special variable, by the way) is | 450 | * # If .INCLUDES (an undocumented special variable, by the way) is | |
451 | * # still undefined, the updated CFLAGS becomes "-I.. $(.INCLUDES)". | 451 | * # still undefined, the updated CFLAGS becomes "-I.. $(.INCLUDES)". | |
452 | */ | 452 | */ | |
453 | extern Boolean preserveUndefined; | 453 | extern Boolean preserveUndefined; | |
454 | 454 | |||
455 | extern SearchPath *sysIncPath; /* The system include path. */ | 455 | /* Used for .include "...". */ | |
456 | extern SearchPath *defSysIncPath; /* The default system include path. */ | 456 | extern SearchPath *parseIncPath; | |
457 | /* Used for .include <...>, for the built-in sys.mk and makefiles from the | |||
458 | * command line arguments. */ | |||
459 | extern SearchPath *sysIncPath; | |||
460 | /* The default for sysIncPath. */ | |||
461 | extern SearchPath *defSysIncPath; | |||
457 | 462 | |||
458 | extern char curdir[]; /* Startup directory */ | 463 | extern char curdir[]; /* Startup directory */ | |
459 | extern char *progname; /* The program name */ | 464 | extern char *progname; /* The program name */ | |
460 | extern char *makeDependfile; /* .depend */ | 465 | extern char *makeDependfile; /* .depend */ | |
461 | extern char **savedEnv; /* if we replaced environ this will be non-NULL */ | 466 | extern char **savedEnv; /* if we replaced environ this will be non-NULL */ | |
462 | 467 | |||
463 | extern int makelevel; | 468 | extern int makelevel; | |
464 | 469 | |||
465 | /* | 470 | /* | |
466 | * We cannot vfork() in a child of vfork(). | 471 | * We cannot vfork() in a child of vfork(). | |
467 | * Most systems do not enforce this but some do. | 472 | * Most systems do not enforce this but some do. | |
468 | */ | 473 | */ | |
469 | #define vFork() ((getpid() == myPid) ? vfork() : fork()) | 474 | #define vFork() ((getpid() == myPid) ? vfork() : fork()) |