Deleted Added
sdiff udiff text old ( 241146 ) new ( 246223 )
full compact
1/* $NetBSD: main.c,v 1.205 2013/01/26 15:53:00 christos Exp $ */
2
3/*
4 * Copyright (c) 1988, 1989, 1990, 1993
5 * The Regents of the University of California. All rights reserved.
6 *
7 * This code is derived from software contributed to Berkeley by
8 * Adam de Boor.
9 *

--- 54 unchanged lines hidden (view full) ---

64 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
65 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
66 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
67 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
68 * SUCH DAMAGE.
69 */
70
71#ifndef MAKE_NATIVE
72static char rcsid[] = "$NetBSD: main.c,v 1.205 2013/01/26 15:53:00 christos Exp $";
73#else
74#include <sys/cdefs.h>
75#ifndef lint
76__COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993\
77 The Regents of the University of California. All rights reserved.");
78#endif /* not lint */
79
80#ifndef lint
81#if 0
82static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94";
83#else
84__RCSID("$NetBSD: main.c,v 1.205 2013/01/26 15:53:00 christos Exp $");
85#endif
86#endif /* not lint */
87#endif
88
89/*-
90 * main.c --
91 * The main file for this entire program. Exit routines etc
92 * reside here.

--- 78 unchanged lines hidden (view full) ---

171Boolean checkEnvFirst; /* -e flag */
172Boolean parseWarnFatal; /* -W flag */
173Boolean jobServer; /* -J flag */
174static int jp_0 = -1, jp_1 = -1; /* ends of parent job pipe */
175Boolean varNoExportEnv; /* -X flag */
176Boolean doing_depend; /* Set while reading .depend */
177static Boolean jobsRunning; /* TRUE if the jobs might be running */
178static const char * tracefile;
179static void MainParseArgs(int, char **);
180static int ReadMakefile(const void *, const void *);
181static void usage(void) MAKE_ATTR_DEAD;
182
183static Boolean ignorePWD; /* if we use -C, PWD is meaningless */
184static char objdir[MAXPATHLEN + 1]; /* where we chdir'ed to */
185char curdir[MAXPATHLEN + 1]; /* Startup directory */
186char *progname; /* the program name */

--- 1009 unchanged lines hidden (view full) ---

1196 if (!compatMake)
1197 Job_ServerStart(maxJobTokens, jp_0, jp_1);
1198 if (DEBUG(JOB))
1199 fprintf(debug_file, "job_pipe %d %d, maxjobs %d, tokens %d, compat %d\n",
1200 jp_0, jp_1, maxJobs, maxJobTokens, compatMake);
1201
1202 Main_ExportMAKEFLAGS(TRUE); /* initial export */
1203
1204 /*
1205 * For compatibility, look at the directories in the VPATH variable
1206 * and add them to the search path, if the variable is defined. The
1207 * variable's value is in the same format as the PATH envariable, i.e.
1208 * <directory>:<directory>:<directory>...
1209 */
1210 if (Var_Exists("VPATH", VAR_CMD)) {
1211 char *vpath, savec;

--- 199 unchanged lines hidden (view full) ---

1411 Var_Set("MAKEFILE", fname, VAR_GLOBAL, 0);
1412 Parse_File(fname, fd);
1413 }
1414 free(path);
1415 return(0);
1416}
1417
1418
1419
1420/*-
1421 * Cmd_Exec --
1422 * Execute the command in cmd, and return the output of that command
1423 * in a string.
1424 *
1425 * Results:
1426 * A string containing the output of the command, or the empty string
1427 * If errnum is not NULL, it contains the reason for the command failure

--- 310 unchanged lines hidden (view full) ---

1738 IOADD(af);
1739 IOADD("(");
1740 IOADD(av);
1741 IOADD(") failed (");
1742 IOADD(strerror(errno));
1743 IOADD(")\n");
1744
1745#ifdef USE_IOVEC
1746 while (writev(2, iov, 8) == -1 && errno == EAGAIN)
1747 continue;
1748#endif
1749}
1750
1751/*
1752 * usage --
1753 * exit with usage message
1754 */
1755static void

--- 178 unchanged lines hidden ---