main.c (236769) | main.c (237578) |
---|---|
1/* $NetBSD: main.c,v 1.199 2012/04/24 20:35:04 sjg Exp $ */ | 1/* $NetBSD: main.c,v 1.200 2012/06/12 19:21:51 joerg 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 | 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.199 2012/04/24 20:35:04 sjg Exp $"; | 72static char rcsid[] = "$NetBSD: main.c,v 1.200 2012/06/12 19:21:51 joerg 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 | 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.199 2012/04/24 20:35:04 sjg Exp $"); | 84__RCSID("$NetBSD: main.c,v 1.200 2012/06/12 19:21:51 joerg 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. --- 82 unchanged lines hidden (view full) --- 175Boolean doing_depend; /* Set while reading .depend */ 176static Boolean jobsRunning; /* TRUE if the jobs might be running */ 177static const char * tracefile; 178#ifndef NO_CHECK_MAKE_CHDIR 179static char * Check_Cwd_av(int, char **, int); 180#endif 181static void MainParseArgs(int, char **); 182static int ReadMakefile(const void *, const void *); | 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. --- 82 unchanged lines hidden (view full) --- 175Boolean doing_depend; /* Set while reading .depend */ 176static Boolean jobsRunning; /* TRUE if the jobs might be running */ 177static const char * tracefile; 178#ifndef NO_CHECK_MAKE_CHDIR 179static char * Check_Cwd_av(int, char **, int); 180#endif 181static void MainParseArgs(int, char **); 182static int ReadMakefile(const void *, const void *); |
183static void usage(void) __dead; | 183static void usage(void) MAKE_ATTR_DEAD; |
184 185static Boolean ignorePWD; /* if we use -C, PWD is meaningless */ 186static char objdir[MAXPATHLEN + 1]; /* where we chdir'ed to */ 187char curdir[MAXPATHLEN + 1]; /* Startup directory */ 188char *progname; /* the program name */ 189char *makeDependfile; 190pid_t myPid; 191 --- 539 unchanged lines hidden (view full) --- 731 n++; 732 } 733 return (n); 734} 735 736#ifdef SIGINFO 737/*ARGSUSED*/ 738static void | 184 185static Boolean ignorePWD; /* if we use -C, PWD is meaningless */ 186static char objdir[MAXPATHLEN + 1]; /* where we chdir'ed to */ 187char curdir[MAXPATHLEN + 1]; /* Startup directory */ 188char *progname; /* the program name */ 189char *makeDependfile; 190pid_t myPid; 191 --- 539 unchanged lines hidden (view full) --- 731 n++; 732 } 733 return (n); 734} 735 736#ifdef SIGINFO 737/*ARGSUSED*/ 738static void |
739siginfo(int signo __unused) | 739siginfo(int signo MAKE_ATTR_UNUSED) |
740{ 741 char dir[MAXPATHLEN]; 742 char str[2 * MAXPATHLEN]; 743 int len; 744 if (getcwd(dir, sizeof(dir)) == NULL) 745 return; 746 len = snprintf(str, sizeof(str), "%s: Working in: %s\n", progname, dir); 747 if (len > 0) --- 587 unchanged lines hidden (view full) --- 1335 * 1336 * Results: 1337 * 0 if ok. -1 if couldn't open file. 1338 * 1339 * Side Effects: 1340 * lots 1341 */ 1342static int | 740{ 741 char dir[MAXPATHLEN]; 742 char str[2 * MAXPATHLEN]; 743 int len; 744 if (getcwd(dir, sizeof(dir)) == NULL) 745 return; 746 len = snprintf(str, sizeof(str), "%s: Working in: %s\n", progname, dir); 747 if (len > 0) --- 587 unchanged lines hidden (view full) --- 1335 * 1336 * Results: 1337 * 0 if ok. -1 if couldn't open file. 1338 * 1339 * Side Effects: 1340 * lots 1341 */ 1342static int |
1343ReadMakefile(const void *p, const void *q __unused) | 1343ReadMakefile(const void *p, const void *q MAKE_ATTR_UNUSED) |
1344{ 1345 const char *fname = p; /* makefile to read */ 1346 int fd; 1347 size_t len = MAXPATHLEN; 1348 char *name, *path = bmake_malloc(len); 1349 1350 if (!strcmp(fname, "-")) { 1351 Parse_File(NULL /*stdin*/, -1); --- 727 unchanged lines hidden --- | 1344{ 1345 const char *fname = p; /* makefile to read */ 1346 int fd; 1347 size_t len = MAXPATHLEN; 1348 char *name, *path = bmake_malloc(len); 1349 1350 if (!strcmp(fname, "-")) { 1351 Parse_File(NULL /*stdin*/, -1); --- 727 unchanged lines hidden --- |