main.c (144896) | main.c (145627) |
---|---|
1/*- 2 * Copyright (c) 1988, 1989, 1990, 1993 3 * The Regents of the University of California. All rights reserved. 4 * Copyright (c) 1989 by Berkeley Softworks 5 * All rights reserved. 6 * 7 * This code is derived from software contributed to Berkeley by 8 * Adam de Boor. --- 32 unchanged lines hidden (view full) --- 41#ifndef lint 42#if 0 43static char copyright[] = 44"@(#) Copyright (c) 1988, 1989, 1990, 1993\n\ 45 The Regents of the University of California. All rights reserved.\n"; 46#endif 47#endif /* not lint */ 48#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1988, 1989, 1990, 1993 3 * The Regents of the University of California. All rights reserved. 4 * Copyright (c) 1989 by Berkeley Softworks 5 * All rights reserved. 6 * 7 * This code is derived from software contributed to Berkeley by 8 * Adam de Boor. --- 32 unchanged lines hidden (view full) --- 41#ifndef lint 42#if 0 43static char copyright[] = 44"@(#) Copyright (c) 1988, 1989, 1990, 1993\n\ 45 The Regents of the University of California. All rights reserved.\n"; 46#endif 47#endif /* not lint */ 48#include <sys/cdefs.h> |
49__FBSDID("$FreeBSD: head/usr.bin/make/main.c 144896 2005-04-11 07:32:49Z harti $"); | 49__FBSDID("$FreeBSD: head/usr.bin/make/main.c 145627 2005-04-28 15:37:25Z harti $"); |
50 51/* 52 * main.c 53 * The main file for this entire program. Exit routines etc 54 * reside here. 55 * 56 * Utility functions defined in this file: 57 * Main_ParseArgLine --- 44 unchanged lines hidden (view full) --- 102#define MAKEFLAGS ".MAKEFLAGS" 103 104/* Targets to be made */ 105Lst create = Lst_Initializer(create); 106 107time_t now; /* Time at start of make */ 108struct GNode *DEFAULT; /* .DEFAULT node */ 109Boolean allPrecious; /* .PRECIOUS given on line by itself */ | 50 51/* 52 * main.c 53 * The main file for this entire program. Exit routines etc 54 * reside here. 55 * 56 * Utility functions defined in this file: 57 * Main_ParseArgLine --- 44 unchanged lines hidden (view full) --- 102#define MAKEFLAGS ".MAKEFLAGS" 103 104/* Targets to be made */ 105Lst create = Lst_Initializer(create); 106 107time_t now; /* Time at start of make */ 108struct GNode *DEFAULT; /* .DEFAULT node */ 109Boolean allPrecious; /* .PRECIOUS given on line by itself */ |
110uint32_t warnflags; |
|
110 111static Boolean noBuiltins; /* -r flag */ 112 113/* ordered list of makefiles to read */ 114static Lst makefiles = Lst_Initializer(makefiles); 115 116static Boolean expandVars; /* fully expand printed variables */ 117 --- 65 unchanged lines hidden (view full) --- 183static void 184MainParseArgs(int argc, char **argv) 185{ 186 int c; 187 188rearg: 189 optind = 1; /* since we're called more than once */ 190 optreset = 1; | 111 112static Boolean noBuiltins; /* -r flag */ 113 114/* ordered list of makefiles to read */ 115static Lst makefiles = Lst_Initializer(makefiles); 116 117static Boolean expandVars; /* fully expand printed variables */ 118 --- 65 unchanged lines hidden (view full) --- 184static void 185MainParseArgs(int argc, char **argv) 186{ 187 int c; 188 189rearg: 190 optind = 1; /* since we're called more than once */ 191 optreset = 1; |
191#define OPTFLAGS "ABC:D:E:I:PSV:Xd:ef:ij:km:nqrstv" | 192#define OPTFLAGS "ABC:D:E:I:PSV:Xd:ef:ij:km:nqrstvx:" |
192 while((c = getopt(argc, argv, OPTFLAGS)) != -1) { 193 switch(c) { 194 195 case 'A': 196 arch_fatal = FALSE; 197 MFLAGS_append("-A", NULL); 198 break; 199 case 'C': --- 140 unchanged lines hidden (view full) --- 340 case 't': 341 touchFlag = TRUE; 342 MFLAGS_append("-t", NULL); 343 break; 344 case 'v': 345 beVerbose = TRUE; 346 MFLAGS_append("-v", NULL); 347 break; | 193 while((c = getopt(argc, argv, OPTFLAGS)) != -1) { 194 switch(c) { 195 196 case 'A': 197 arch_fatal = FALSE; 198 MFLAGS_append("-A", NULL); 199 break; 200 case 'C': --- 140 unchanged lines hidden (view full) --- 341 case 't': 342 touchFlag = TRUE; 343 MFLAGS_append("-t", NULL); 344 break; 345 case 'v': 346 beVerbose = TRUE; 347 MFLAGS_append("-v", NULL); 348 break; |
349 case 'x': 350 if (strncmp(optarg, "dirsyntax", strlen(optarg)) == 0) { 351 MFLAGS_append("-x", optarg); 352 warnflags |= WARN_DIRSYNTAX; 353 } 354 break; 355 |
|
348 default: 349 case '?': 350 usage(); 351 } 352 } 353 argv += optind; 354 argc -= optind; 355 --- 805 unchanged lines hidden (view full) --- 1161 1162/* 1163 * usage -- 1164 * exit with usage message 1165 */ 1166static void 1167usage(void) 1168{ | 356 default: 357 case '?': 358 usage(); 359 } 360 } 361 argv += optind; 362 argc -= optind; 363 --- 805 unchanged lines hidden (view full) --- 1169 1170/* 1171 * usage -- 1172 * exit with usage message 1173 */ 1174static void 1175usage(void) 1176{ |
1169 fprintf(stderr, "%s\n%s\n%s\n", 1170"usage: make [-BPSXeiknqrstv] [-C directory] [-D variable] [-d flags]", | 1177 fprintf(stderr, "%s\n%s\n%s\n%s\n", 1178"usage: make [-ABPSXeiknqrstv] [-C directory] [-D variable] [-d flags]", |
1171" [-E variable] [-f makefile] [-I directory] [-j max_jobs]", | 1179" [-E variable] [-f makefile] [-I directory] [-j max_jobs]", |
1172" [-m directory] [-V variable] [variable=value] [target ...]"); | 1180" [-m directory] [-V variable] [variable=value] [-x warn_flag]", 1181" [target ...]"); |
1173 exit(2); 1174} | 1182 exit(2); 1183} |