Wed Nov 4 13:29:42 2020 UTC ()
make(1): move declaration of parseIncPath from main.c to make.h


(rillig)
diff -r1.424 -r1.425 src/usr.bin/make/main.c
diff -r1.185 -r1.186 src/usr.bin/make/make.h

cvs diff -r1.424 -r1.425 src/usr.bin/make/main.c (expand / switch to unified diff)

--- 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" */
121MAKE_RCSID("$NetBSD: main.c,v 1.424 2020/11/04 13:22:15 rillig Exp $"); 121MAKE_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
132CmdOpts opts; 132CmdOpts opts;
133time_t now; /* Time at start of make */ 133time_t now; /* Time at start of make */
134GNode *DEFAULT; /* .DEFAULT node */ 134GNode *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;
148static void purge_cached_realpaths(void); 148static void purge_cached_realpaths(void);
149 149
150static Boolean ignorePWD; /* if we use -C, PWD is meaningless */ 150static Boolean ignorePWD; /* if we use -C, PWD is meaningless */
151static char objdir[MAXPATHLEN + 1]; /* where we chdir'ed to */ 151static char objdir[MAXPATHLEN + 1]; /* where we chdir'ed to */
152char curdir[MAXPATHLEN + 1]; /* Startup directory */ 152char curdir[MAXPATHLEN + 1]; /* Startup directory */
153char *progname; /* the program name */ 153char *progname; /* the program name */
154char *makeDependfile; 154char *makeDependfile;
155pid_t myPid; 155pid_t myPid;
156int makelevel; 156int makelevel;
157 157
158Boolean forceJobs = FALSE; 158Boolean forceJobs = FALSE;
159static int errors = 0; 159static int errors = 0;
160 160
161extern 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 */
167static char * 165static char *
168explode(const char *flags) 166explode(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;

cvs diff -r1.185 -r1.186 src/usr.bin/make/make.h (expand / switch to unified diff)

--- 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 */
453extern Boolean preserveUndefined; 453extern Boolean preserveUndefined;
454 454
455extern SearchPath *sysIncPath; /* The system include path. */ 455/* Used for .include "...". */
456extern SearchPath *defSysIncPath; /* The default system include path. */ 456extern SearchPath *parseIncPath;
 457/* Used for .include <...>, for the built-in sys.mk and makefiles from the
 458 * command line arguments. */
 459extern SearchPath *sysIncPath;
 460/* The default for sysIncPath. */
 461extern SearchPath *defSysIncPath;
457 462
458extern char curdir[]; /* Startup directory */ 463extern char curdir[]; /* Startup directory */
459extern char *progname; /* The program name */ 464extern char *progname; /* The program name */
460extern char *makeDependfile; /* .depend */ 465extern char *makeDependfile; /* .depend */
461extern char **savedEnv; /* if we replaced environ this will be non-NULL */ 466extern char **savedEnv; /* if we replaced environ this will be non-NULL */
462 467
463extern int makelevel; 468extern 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())