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
7 * This code is derived from software contributed to Berkeley by
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. All advertising materials mentioning features or use of this software
19 * must display the following acknowledgement:
20 * This product includes software developed by the University of
21 * California, Berkeley and its contributors.
22 * 4. Neither the name of the University nor the names of its contributors
23 * may be used to endorse or promote products derived from this software
24 * without specific prior written permission.
26 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
27 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
30 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
38 * @(#) Copyright (c) 1988, 1989, 1990, 1993 The Regents of the University of California. All rights reserved.
39 * @(#)main.c 8.3 (Berkeley) 3/19/94
40 * $FreeBSD: src/usr.bin/make/main.c,v 1.118 2005/02/13 13:33:56 harti Exp $
41 * $DragonFly: src/usr.bin/make/main.c,v 1.90 2005/05/05 09:08:42 okumoto Exp $
46 * The main file for this entire program. Exit routines etc
49 * Utility functions defined in this file:
51 * Takes a line of arguments, breaks them and
52 * treats them as if they were given when first
53 * invoked. Used by the parse module to implement
58 #include <sys/utsname.h>
60 #include <sys/param.h>
63 #include <sys/queue.h>
64 #include <sys/resource.h>
80 #include "pathnames.h"
87 extern char **environ; /* XXX what header declares this variable? */
89 #define WANT_ENV_MKLVL 1
90 #define MKLVL_MAXVAL 500
91 #define MKLVL_ENVVAR "__MKLVL__"
95 * This control the default concurrency. On no occasion will more
96 * than DEFMAXJOBS targets be created at once.
100 /* ordered list of makefiles to read */
101 static Lst makefiles = Lst_Initializer(makefiles);
103 /* list of variables to print */
104 static Lst variables = Lst_Initializer(variables);
106 static Boolean expandVars; /* fully expand printed variables */
107 static Boolean noBuiltins; /* -r flag */
108 static Boolean forceJobs; /* -j argument given */
109 static char *curdir; /* startup directory */
110 static char *objdir; /* where we chdir'ed to */
112 /* (-E) vars to override from env */
113 Lst envFirstVars = Lst_Initializer(envFirstVars);
115 /* Targets to be made */
116 Lst create = Lst_Initializer(create);
118 Boolean allPrecious; /* .PRECIOUS given on line by itself */
119 Boolean beSilent; /* -s flag */
120 Boolean beVerbose; /* -v flag */
121 Boolean compatMake; /* -B argument */
122 Boolean debug; /* -d flag */
123 Boolean ignoreErrors; /* -i flag */
124 Boolean jobsRunning; /* TRUE if the jobs might be running */
125 Boolean keepgoing; /* -k flag */
126 Boolean noExecute; /* -n flag */
127 Boolean queryFlag; /* -q flag */
128 Boolean touchFlag; /* -t flag */
129 Boolean usePipes; /* !-P flag */
130 uint32_t warn_flags; /* actual warning flags */
131 uint32_t warn_cmd; /* command line warning flags */
132 uint32_t warn_nocmd; /* command line no-warning flags */
134 time_t now; /* Time at start of make */
135 struct GNode *DEFAULT; /* .DEFAULT node */
138 * Exit with usage message.
144 "usage: make [-BPSXeiknqrstv] [-C directory] [-D variable]\n"
145 "\t[-d flags] [-E variable] [-f makefile] [-I directory]\n"
146 "\t[-j max_jobs] [-m directory] [-V variable]\n"
147 "\t[variable=value] [target ...]\n");
153 * Append a flag with an optional argument to MAKEFLAGS and MFLAGS
156 MFLAGS_append(const char *flag, char *arg)
160 Var_Append(".MAKEFLAGS", flag, VAR_GLOBAL);
162 str = MAKEFLAGS_quote(arg);
163 Var_Append(".MAKEFLAGS", str, VAR_GLOBAL);
167 Var_Append("MFLAGS", flag, VAR_GLOBAL);
169 str = MAKEFLAGS_quote(arg);
170 Var_Append("MFLAGS", str, VAR_GLOBAL);
176 * Open and parse the given makefile.
179 * TRUE if ok. FALSE if couldn't open file.
182 ReadMakefile(const char p[])
184 char *fname; /* makefile to read */
186 char *name, path[MAXPATHLEN];
190 /* XXX - remove this once constification is done */
193 if (!strcmp(fname, "-")) {
194 Parse_File("(stdin)", stdin);
195 Var_SetGlobal("MAKEFILE", "");
197 setMAKEFILE = strcmp(fname, ".depend");
199 /* if we've chdir'd, rebuild the path name */
200 if (curdir != objdir && *fname != '/') {
201 snprintf(path, MAXPATHLEN, "%s/%s", curdir, fname);
203 * XXX The realpath stuff breaks relative includes
204 * XXX in some cases. The problem likely is in
205 * XXX parse.c where it does special things in
206 * XXX ParseDoInclude if the file is relateive
207 * XXX or absolute and not a system file. There
208 * XXX it assumes that if the current file that's
209 * XXX being included is absolute, that any files
210 * XXX that it includes shouldn't do the -I path
211 * XXX stuff, which is inconsistant with historical
212 * XXX behavior. However, I can't pentrate the mists
213 * XXX further, so I'm putting this workaround in
214 * XXX here until such time as the underlying bug
217 #if THIS_BREAKS_THINGS
218 if (realpath(path, path) != NULL &&
219 (stream = fopen(path, "r")) != NULL) {
224 } else if (realpath(fname, path) != NULL) {
227 if ((stream = fopen(fname, "r")) != NULL)
231 if ((stream = fopen(path, "r")) != NULL) {
238 if ((stream = fopen(fname, "r")) != NULL)
242 /* look in -I and system include directories. */
243 name = Path_FindFile(fname, &parseIncPath);
245 name = Path_FindFile(fname, &sysIncPath);
246 if (!name || !(stream = fopen(name, "r")))
248 MAKEFILE = fname = name;
250 * set the MAKEFILE variable desired by System V fans -- the
251 * placement of the setting here means it gets set to the last
252 * makefile specified, as it is set by SysV make.
256 Var_SetGlobal("MAKEFILE", MAKEFILE);
257 Parse_File(fname, stream);
266 * Handle argument to warning option.
269 Main_ParseWarn(const char *arg, int iscmd)
273 static const struct {
277 { "dirsyntax", WARN_DIRSYNTAX },
282 if (arg[0] == 'n' && arg[1] == 'o') {
287 for (i = 0; options[i].option != NULL; i++)
288 if (strcmp(arg, options[i].option) == 0)
291 if (options[i].option == NULL)
297 warn_cmd |= options[i].flag;
298 warn_nocmd &= ~options[i].flag;
299 warn_flags |= options[i].flag;
301 warn_nocmd |= options[i].flag;
302 warn_cmd &= ~options[i].flag;
303 warn_flags &= ~options[i].flag;
307 warn_flags |= (options[i].flag & ~warn_nocmd);
309 warn_flags &= ~(options[i].flag | warn_cmd);
317 * Parse a given argument vector. Called from main() and from
318 * Main_ParseArgLine() when the .MAKEFLAGS target is used.
320 * XXX: Deal with command line overriding .MAKEFLAGS in makefile
323 * Various global and local flags will be set depending on the flags
327 MainParseArgs(int argc, char **argv)
330 Boolean found_dd = FALSE;
333 optind = 1; /* since we're called more than once */
335 #define OPTFLAGS "ABC:D:E:I:PSV:Xd:ef:ij:km:nqrstvx:"
337 if ((optind < argc) && strcmp(argv[optind], "--") == 0) {
340 if ((c = getopt(argc, argv, OPTFLAGS)) == -1) {
347 MFLAGS_append("-A", NULL);
350 if (chdir(optarg) == -1)
351 err(1, "chdir %s", optarg);
354 Var_SetGlobal(optarg, "1");
355 MFLAGS_append("-D", optarg);
358 Parse_AddIncludeDir(optarg);
359 MFLAGS_append("-I", optarg);
362 Lst_AtEnd(&variables, estrdup(optarg));
363 MFLAGS_append("-V", optarg);
370 MFLAGS_append("-B", NULL);
371 unsetenv("MAKE_JOBS_FIFO");
375 MFLAGS_append("-P", NULL);
379 MFLAGS_append("-S", NULL);
382 char *modules = optarg;
384 for (; *modules; ++modules)
402 if (modules[1] == '1') {
403 debug |= DEBUG_GRAPH1;
406 else if (modules[1] == '2') {
407 debug |= DEBUG_GRAPH2;
430 warnx("illegal argument to d option "
434 MFLAGS_append("-d", optarg);
438 Lst_AtEnd(&envFirstVars, estrdup(optarg));
439 MFLAGS_append("-E", optarg);
442 checkEnvFirst = TRUE;
443 MFLAGS_append("-e", NULL);
446 Lst_AtEnd(&makefiles, estrdup(optarg));
450 MFLAGS_append("-i", NULL);
456 maxJobs = strtol(optarg, &endptr, 10);
457 if (maxJobs <= 0 || *endptr != '\0') {
458 warnx("illegal number, -j argument -- %s",
462 MFLAGS_append("-j", optarg);
467 MFLAGS_append("-k", NULL);
470 Path_AddDir(&sysIncPath, optarg);
471 MFLAGS_append("-m", optarg);
475 MFLAGS_append("-n", NULL);
479 /* Kind of nonsensical, wot? */
480 MFLAGS_append("-q", NULL);
484 MFLAGS_append("-r", NULL);
488 MFLAGS_append("-s", NULL);
492 MFLAGS_append("-t", NULL);
496 MFLAGS_append("-v", NULL);
499 if (Main_ParseWarn(optarg, 1) != -1)
500 MFLAGS_append("-x", optarg);
514 * Parse the rest of the arguments.
515 * o Check for variable assignments and perform them if so.
516 * o Check for more flags and restart getopt if so.
517 * o Anything else is taken to be a target and added
518 * to the end of the "create" list.
520 for (; *argv != NULL; ++argv, --argc) {
521 if (Parse_IsVar(*argv)) {
522 char *ptr = MAKEFLAGS_quote(*argv);
524 Var_Append(".MAKEFLAGS", ptr, VAR_GLOBAL);
525 Parse_DoVar(*argv, VAR_CMD);
528 } else if ((*argv)[0] == '-') {
529 if ((*argv)[1] == '\0') {
531 * (*argv) is a single dash, so we
534 } else if (found_dd) {
536 * Double dash has been found, ignore
537 * any more options. But what do we do
538 * with it? For now treat it like a target.
540 Lst_AtEnd(&create, estrdup(*argv));
543 * (*argv) is a -flag, so backup argv and
544 * argc. getopt() expects options to start
545 * in the 2nd position.
552 } else if ((*argv)[0] == '\0') {
553 Punt("illegal (null) argument.");
556 Lst_AtEnd(&create, estrdup(*argv));
563 * Used by the parse module when a .MFLAGS or .MAKEFLAGS target
564 * is encountered and by main() when reading the .MAKEFLAGS envariable.
565 * Takes a line of arguments and breaks it into its
566 * component words and passes those words and the number of them to the
567 * MainParseArgs function.
568 * The line should have all its leading whitespace removed.
571 * Only those that come from the various arguments.
574 Main_ParseArgLine(char *line, int mflags)
580 for (; *line == ' '; ++line)
586 MAKEFLAGS_break(&aa, line);
588 brk_string(&aa, line, TRUE);
590 MainParseArgs(aa.argc, aa.argv);
595 chdir_verify_path(const char *path, char *obpath)
599 if (stat(path, &sb) == 0 && S_ISDIR(sb.st_mode)) {
600 if (chdir(path) == -1 || getcwd(obpath, MAXPATHLEN) == NULL) {
601 warn("warning: %s", path);
611 * In lieu of a good way to prevent every possible looping in make(1), stop
612 * there from being more than MKLVL_MAXVAL processes forked by make(1), to
613 * prevent a forkbomb from happening, in a dumb and mechanical way.
616 * Creates or modifies enviornment variable MKLVL_ENVVAR via setenv().
619 check_make_level(void)
621 #ifdef WANT_ENV_MKLVL
622 char *value = getenv(MKLVL_ENVVAR);
623 int level = (value == NULL) ? 0 : atoi(value);
626 errc(2, EAGAIN, "Invalid value for recursion level (%d).",
628 } else if (level > MKLVL_MAXVAL) {
629 errc(2, EAGAIN, "Max recursion level (%d) exceeded.",
633 sprintf(new_value, "%d", level + 1);
634 setenv(MKLVL_ENVVAR, new_value, 1);
636 #endif /* WANT_ENV_MKLVL */
641 * The main function, for obvious reasons. Initializes variables
642 * and a few modules, then parses the arguments give it in the
643 * environment and on the command line. Reads the system makefile
644 * followed by either Makefile, makefile or the file given by the
645 * -f argument. Sets the .MAKEFLAGS PMake variable based on all the
646 * flags it has received by then uses either the Make or the Compat
647 * module to create the initial list of targets.
650 * If -q was given, exits -1 if anything was out-of-date. Else it exits
654 * The program exits when done. Targets are created. etc. etc. etc.
657 main(int argc, char **argv)
660 const char *machine_arch;
661 const char *machine_cpu;
662 Boolean outOfDate = TRUE; /* FALSE if all targets up to date */
666 char mdpath[MAXPATHLEN];
667 char obpath[MAXPATHLEN];
668 char cdpath[MAXPATHLEN];
669 char *cp = NULL, *start;
672 * Initialize file global variables.
675 noBuiltins = FALSE; /* Read the built-in rules */
676 forceJobs = FALSE; /* No -j flag */
680 * Initialize program global variables.
682 beSilent = FALSE; /* Print commands as executed */
683 ignoreErrors = FALSE; /* Pay attention to non-zero returns */
684 noExecute = FALSE; /* Execute all commands */
685 keepgoing = FALSE; /* Stop on error */
686 allPrecious = FALSE; /* Remove targets when interrupted */
687 queryFlag = FALSE; /* This is not just a check-run */
688 touchFlag = FALSE; /* Actually update targets */
689 usePipes = TRUE; /* Catch child output in pipes */
690 debug = 0; /* No debug verbosity, please. */
693 maxJobs = DEFMAXJOBS;
694 compatMake = FALSE; /* No compat mode */
700 * get rid of resource limit on file descriptors
704 if (getrlimit(RLIMIT_NOFILE, &rl) == -1) {
707 rl.rlim_cur = rl.rlim_max;
708 if (setrlimit(RLIMIT_NOFILE, &rl) == -1) {
714 * Get the name of this type of MACHINE from utsname
715 * so we can share an executable for similar machines.
716 * (i.e. m68k: amiga hp300, mac68k, sun3, ...)
718 * Note that while MACHINE is decided at run-time,
719 * MACHINE_ARCH is always known at compile time.
721 if ((machine = getenv("MACHINE")) == NULL) {
725 static struct utsname utsname;
727 if (uname(&utsname) == -1)
729 machine = utsname.machine;
733 if ((machine_arch = getenv("MACHINE_ARCH")) == NULL) {
735 machine_arch = MACHINE_ARCH;
737 machine_arch = "unknown";
742 * Set machine_cpu to the minumum supported CPU revision based
743 * on the target architecture, if not already set.
745 if ((machine_cpu = getenv("MACHINE_CPU")) == NULL) {
746 if (!strcmp(machine_arch, "i386"))
747 machine_cpu = "i386";
748 else if (!strcmp(machine_arch, "alpha"))
751 machine_cpu = "unknown";
755 * Initialize the parsing, directory and variable modules to prepare
756 * for the reading of inclusion paths and variable settings on the
761 Dir_Init(); /* Initialize directory structures so -I flags
762 * can be processed correctly */
763 Var_Init(environ); /* As well as the lists of variables for
764 * parsing arguments */
767 * Initialize various variables.
768 * MAKE also gets this name, for compatibility
769 * .MAKEFLAGS gets set to the empty string just in case.
770 * MFLAGS also gets initialized empty, for compatibility.
772 Var_SetGlobal("MAKE", argv[0]);
773 Var_SetGlobal(".MAKEFLAGS", "");
774 Var_SetGlobal("MFLAGS", "");
775 Var_SetGlobal("MACHINE", machine);
776 Var_SetGlobal("MACHINE_ARCH", machine_arch);
777 Var_SetGlobal("MACHINE_CPU", machine_cpu);
779 Var_SetGlobal("MAKE_VERSION", MAKE_VERSION);
783 * First snag things out of the MAKEFLAGS environment
784 * variable. Then parse the command line arguments.
786 Main_ParseArgLine(getenv("MAKEFLAGS"), 1);
788 MainParseArgs(argc, argv);
791 * Find where we are...
793 if (getcwd(curdir, MAXPATHLEN) == NULL)
799 if (stat(curdir, &sa) == -1)
800 err(2, "%s", curdir);
804 * The object directory location is determined using the
805 * following order of preference:
807 * 1. MAKEOBJDIRPREFIX`cwd`
809 * 3. PATH_OBJDIR.${MACHINE}
811 * 5. PATH_OBJDIRPREFIX`cwd`
813 * If one of the first two fails, use the current directory.
814 * If the remaining three all fail, use the current directory.
816 * Once things are initted,
817 * have to add the original directory to the search path,
818 * and modify the paths for the Makefiles apropriately. The
819 * current directory is also placed as a variable for make scripts.
821 if (!(pathp = getenv("MAKEOBJDIRPREFIX"))) {
822 if (!(path = getenv("MAKEOBJDIR"))) {
824 pathp = PATH_OBJDIRPREFIX;
825 snprintf(mdpath, MAXPATHLEN, "%s.%s", path, machine);
826 if (!(objdir = chdir_verify_path(mdpath, obpath)))
827 if (!(objdir=chdir_verify_path(path, obpath))) {
828 snprintf(mdpath, MAXPATHLEN,
829 "%s%s", pathp, curdir);
830 if (!(objdir=chdir_verify_path(mdpath,
835 else if (!(objdir = chdir_verify_path(path, obpath)))
839 snprintf(mdpath, MAXPATHLEN, "%s%s", pathp, curdir);
840 if (!(objdir = chdir_verify_path(mdpath, obpath)))
843 Dir_InitDot(); /* Initialize the "." directory */
844 if (objdir != curdir)
845 Path_AddDir(&dirSearchPath, curdir);
846 Var_SetGlobal(".DIRECTIVE_MAKEENV", "YES");
847 Var_SetGlobal(".ST_EXPORTVAR", "YES");
848 Var_SetGlobal(".CURDIR", curdir);
849 Var_SetGlobal(".OBJDIR", objdir);
851 if (getenv("MAKE_JOBS_FIFO") != NULL)
854 * Be compatible if user did not specify -j and did not explicitly
855 * turned compatibility on
857 if (!compatMake && !forceJobs)
861 * Initialize target and suffix modules in preparation for
862 * parsing the makefile(s)
871 * Set up the .TARGETS variable to contain the list of targets to be
872 * created. If none specified, make the variable empty -- the parser
873 * will fill the thing in with the default or .MAIN target.
875 if (Lst_IsEmpty(&create)) {
876 Var_SetGlobal(".TARGETS", "");
880 for (ln = Lst_First(&create); ln != NULL; ln = Lst_Succ(ln)) {
881 char *name = Lst_Datum(ln);
883 Var_Append(".TARGETS", name, VAR_GLOBAL);
889 * If no user-supplied system path was given (through the -m option)
890 * add the directories from the DEFSYSPATH (more than one may be given
891 * as dir1:...:dirn) to the system include path.
893 if (TAILQ_EMPTY(&sysIncPath)) {
894 char syspath[] = PATH_DEFSYSPATH;
896 for (start = syspath; *start != '\0'; start = cp) {
897 for (cp = start; *cp != '\0' && *cp != ':'; cp++)
900 Path_AddDir(&sysIncPath, start);
903 Path_AddDir(&sysIncPath, start);
909 * Read in the built-in rules first, followed by the specified
910 * makefile, if it was (makefile != (char *) NULL), or the default
911 * Makefile and makefile, in that order, if it wasn't.
915 Lst sysMkPath = Lst_Initializer(sysMkPath);
917 char defsysmk[] = PATH_DEFSYSMK;
919 Path_Expand(defsysmk, &sysIncPath, &sysMkPath);
920 if (Lst_IsEmpty(&sysMkPath))
921 Fatal("make: no system rules (%s).", PATH_DEFSYSMK);
922 LST_FOREACH(ln, &sysMkPath) {
923 if (!ReadMakefile(Lst_Datum(ln)))
927 Fatal("make: cannot open %s.", (char *)Lst_Datum(ln));
928 Lst_Destroy(&sysMkPath, free);
931 if (!Lst_IsEmpty(&makefiles)) {
934 LST_FOREACH(ln, &makefiles) {
935 if (!ReadMakefile(Lst_Datum(ln)))
939 Fatal("make: cannot open %s.", (char *)Lst_Datum(ln));
940 } else if (!ReadMakefile("BSDmakefile"))
941 if (!ReadMakefile("makefile"))
942 ReadMakefile("Makefile");
944 ReadMakefile(".depend");
946 /* Install all the flags into the MAKE envariable. */
947 if (((p = Var_Value(".MAKEFLAGS", VAR_GLOBAL, &p1)) != NULL) && *p)
948 setenv("MAKEFLAGS", p, 1);
952 * For compatibility, look at the directories in the VPATH variable
953 * and add them to the search path, if the variable is defined. The
954 * variable's value is in the same format as the PATH envariable, i.e.
955 * <directory>:<directory>:<directory>...
957 if (Var_Exists("VPATH", VAR_CMD)) {
959 * GCC stores string constants in read-only memory, but
960 * Var_Subst will want to write this thing, so store it
963 static char VPATH[] = "${VPATH}";
969 buf = Var_Subst(VPATH, VAR_CMD, FALSE);
971 vpath = Buf_Data(buf);
973 /* skip to end of directory */
974 for (ptr = vpath; *ptr != ':' && *ptr != '\0'; ptr++)
977 /* Save terminator character so know when to stop */
981 /* Add directory to search path */
982 Path_AddDir(&dirSearchPath, vpath);
985 } while (savec != '\0');
987 Buf_Destroy(buf, TRUE);
991 * Now that all search paths have been read for suffixes et al, it's
992 * time to add the default search path to their lists...
996 /* print the initial graph, if the user requested it */
1000 /* print the values of any variables requested by the user */
1001 if (Lst_IsEmpty(&variables)) {
1003 * Since the user has not requested that any variables
1004 * be printed, we can build targets.
1006 * Have read the entire graph and need to make a list of targets
1007 * to create. If none was given on the command line, we consult
1008 * the parsing module to find the main target(s) to create.
1010 Lst targs = Lst_Initializer(targs);
1012 if (Lst_IsEmpty(&create))
1013 Parse_MainName(&targs);
1015 Targ_FindList(&targs, &create, TARG_CREATE);
1019 * Compat_Init will take care of creating
1020 * all the targets as well as initializing
1027 * Initialize job module before traversing
1028 * the graph, now that any .BEGIN and .END
1029 * targets have been read. This is done
1030 * only if the -q flag wasn't given (to
1031 * prevent the .BEGIN from being executed
1039 /* Traverse the graph, checking on all the targets */
1040 outOfDate = Make_Run(&targs);
1042 Lst_Destroy(&targs, NOFREE);
1045 Var_Print(&variables, expandVars);
1048 Lst_Destroy(&variables, free);
1049 Lst_Destroy(&makefiles, free);
1050 Lst_Destroy(&create, free);
1052 /* print the graph now it's been processed if the user requested it */
1056 if (queryFlag && outOfDate)