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.94 2005/05/16 17:32:15 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 int jobLimit; /* -j argument */
125 Boolean jobsRunning; /* TRUE if the jobs might be running */
126 Boolean keepgoing; /* -k flag */
127 Boolean noExecute; /* -n flag */
128 Boolean queryFlag; /* -q flag */
129 Boolean touchFlag; /* -t flag */
130 Boolean usePipes; /* !-P flag */
131 uint32_t warn_cmd; /* command line warning flags */
132 uint32_t warn_flags; /* actual warning flags */
133 uint32_t warn_nocmd; /* command line no-warning flags */
135 time_t now; /* Time at start of make */
136 struct GNode *DEFAULT; /* .DEFAULT node */
139 * Exit with usage message.
145 "usage: make [-BPSXeiknqrstv] [-C directory] [-D variable]\n"
146 "\t[-d flags] [-E variable] [-f makefile] [-I directory]\n"
147 "\t[-j max_jobs] [-m directory] [-V variable]\n"
148 "\t[variable=value] [target ...]\n");
154 * Append a flag with an optional argument to MAKEFLAGS and MFLAGS
157 MFLAGS_append(const char *flag, char *arg)
161 Var_Append(".MAKEFLAGS", flag, VAR_GLOBAL);
163 str = MAKEFLAGS_quote(arg);
164 Var_Append(".MAKEFLAGS", str, VAR_GLOBAL);
168 Var_Append("MFLAGS", flag, VAR_GLOBAL);
170 str = MAKEFLAGS_quote(arg);
171 Var_Append("MFLAGS", str, VAR_GLOBAL);
177 * Open and parse the given makefile.
180 * TRUE if ok. FALSE if couldn't open file.
183 ReadMakefile(const char p[])
185 char *fname; /* makefile to read */
187 char *name, path[MAXPATHLEN];
191 /* XXX - remove this once constification is done */
194 if (!strcmp(fname, "-")) {
195 Parse_File("(stdin)", stdin);
196 Var_SetGlobal("MAKEFILE", "");
198 setMAKEFILE = strcmp(fname, ".depend");
200 /* if we've chdir'd, rebuild the path name */
201 if (curdir != objdir && *fname != '/') {
202 snprintf(path, MAXPATHLEN, "%s/%s", curdir, fname);
204 * XXX The realpath stuff breaks relative includes
205 * XXX in some cases. The problem likely is in
206 * XXX parse.c where it does special things in
207 * XXX ParseDoInclude if the file is relateive
208 * XXX or absolute and not a system file. There
209 * XXX it assumes that if the current file that's
210 * XXX being included is absolute, that any files
211 * XXX that it includes shouldn't do the -I path
212 * XXX stuff, which is inconsistant with historical
213 * XXX behavior. However, I can't pentrate the mists
214 * XXX further, so I'm putting this workaround in
215 * XXX here until such time as the underlying bug
218 #if THIS_BREAKS_THINGS
219 if (realpath(path, path) != NULL &&
220 (stream = fopen(path, "r")) != NULL) {
225 } else if (realpath(fname, path) != NULL) {
228 if ((stream = fopen(fname, "r")) != NULL)
232 if ((stream = fopen(path, "r")) != NULL) {
239 if ((stream = fopen(fname, "r")) != NULL)
243 /* look in -I and system include directories. */
244 name = Path_FindFile(fname, &parseIncPath);
246 name = Path_FindFile(fname, &sysIncPath);
247 if (!name || !(stream = fopen(name, "r")))
249 MAKEFILE = fname = name;
251 * set the MAKEFILE variable desired by System V fans -- the
252 * placement of the setting here means it gets set to the last
253 * makefile specified, as it is set by SysV make.
257 Var_SetGlobal("MAKEFILE", MAKEFILE);
258 Parse_File(fname, stream);
267 * Handle argument to warning option.
270 Main_ParseWarn(const char *arg, int iscmd)
274 static const struct {
278 { "dirsyntax", WARN_DIRSYNTAX },
283 if (arg[0] == 'n' && arg[1] == 'o') {
288 for (i = 0; options[i].option != NULL; i++)
289 if (strcmp(arg, options[i].option) == 0)
292 if (options[i].option == NULL)
298 warn_cmd |= options[i].flag;
299 warn_nocmd &= ~options[i].flag;
300 warn_flags |= options[i].flag;
302 warn_nocmd |= options[i].flag;
303 warn_cmd &= ~options[i].flag;
304 warn_flags &= ~options[i].flag;
308 warn_flags |= (options[i].flag & ~warn_nocmd);
310 warn_flags &= ~(options[i].flag | warn_cmd);
318 * Parse a given argument vector. Called from main() and from
319 * Main_ParseArgLine() when the .MAKEFLAGS target is used.
321 * XXX: Deal with command line overriding .MAKEFLAGS in makefile
324 * Various global and local flags will be set depending on the flags
328 MainParseArgs(int argc, char **argv)
331 Boolean found_dd = FALSE;
334 optind = 1; /* since we're called more than once */
336 #define OPTFLAGS "ABC:D:E:I:PSV:Xd:ef:ij:km:nqrstvx:"
338 if ((optind < argc) && strcmp(argv[optind], "--") == 0) {
341 if ((c = getopt(argc, argv, OPTFLAGS)) == -1) {
348 MFLAGS_append("-A", NULL);
351 if (chdir(optarg) == -1)
352 err(1, "chdir %s", optarg);
355 Var_SetGlobal(optarg, "1");
356 MFLAGS_append("-D", optarg);
359 Parse_AddIncludeDir(optarg);
360 MFLAGS_append("-I", optarg);
363 Lst_AtEnd(&variables, estrdup(optarg));
364 MFLAGS_append("-V", optarg);
371 MFLAGS_append("-B", NULL);
372 unsetenv("MAKE_JOBS_FIFO");
376 MFLAGS_append("-P", NULL);
380 MFLAGS_append("-S", NULL);
383 char *modules = optarg;
385 for (; *modules; ++modules)
403 if (modules[1] == '1') {
404 debug |= DEBUG_GRAPH1;
407 else if (modules[1] == '2') {
408 debug |= DEBUG_GRAPH2;
431 warnx("illegal argument to d option "
435 MFLAGS_append("-d", optarg);
439 Lst_AtEnd(&envFirstVars, estrdup(optarg));
440 MFLAGS_append("-E", optarg);
443 checkEnvFirst = TRUE;
444 MFLAGS_append("-e", NULL);
447 Lst_AtEnd(&makefiles, estrdup(optarg));
451 MFLAGS_append("-i", NULL);
457 jobLimit = strtol(optarg, &endptr, 10);
458 if (jobLimit <= 0 || *endptr != '\0') {
459 warnx("illegal number, -j argument -- %s",
463 MFLAGS_append("-j", optarg);
468 MFLAGS_append("-k", NULL);
471 Path_AddDir(&sysIncPath, optarg);
472 MFLAGS_append("-m", optarg);
476 MFLAGS_append("-n", NULL);
480 /* Kind of nonsensical, wot? */
481 MFLAGS_append("-q", NULL);
485 MFLAGS_append("-r", NULL);
489 MFLAGS_append("-s", NULL);
493 MFLAGS_append("-t", NULL);
497 MFLAGS_append("-v", NULL);
500 if (Main_ParseWarn(optarg, 1) != -1)
501 MFLAGS_append("-x", optarg);
515 * Parse the rest of the arguments.
516 * o Check for variable assignments and perform them if so.
517 * o Check for more flags and restart getopt if so.
518 * o Anything else is taken to be a target and added
519 * to the end of the "create" list.
521 for (; *argv != NULL; ++argv, --argc) {
522 if (Parse_IsVar(*argv)) {
523 char *ptr = MAKEFLAGS_quote(*argv);
525 Var_Append(".MAKEFLAGS", ptr, VAR_GLOBAL);
526 Parse_DoVar(*argv, VAR_CMD);
529 } else if ((*argv)[0] == '-') {
530 if ((*argv)[1] == '\0') {
532 * (*argv) is a single dash, so we
535 } else if (found_dd) {
537 * Double dash has been found, ignore
538 * any more options. But what do we do
539 * with it? For now treat it like a target.
541 Lst_AtEnd(&create, estrdup(*argv));
544 * (*argv) is a -flag, so backup argv and
545 * argc. getopt() expects options to start
546 * in the 2nd position.
553 } else if ((*argv)[0] == '\0') {
554 Punt("illegal (null) argument.");
557 Lst_AtEnd(&create, estrdup(*argv));
564 * Used by the parse module when a .MFLAGS or .MAKEFLAGS target
565 * is encountered and by main() when reading the .MAKEFLAGS envariable.
566 * Takes a line of arguments and breaks it into its
567 * component words and passes those words and the number of them to the
568 * MainParseArgs function.
569 * The line should have all its leading whitespace removed.
572 * Only those that come from the various arguments.
575 Main_ParseArgLine(char *line, int mflags)
581 for (; *line == ' '; ++line)
587 MAKEFLAGS_break(&aa, line);
589 brk_string(&aa, line, TRUE);
591 MainParseArgs(aa.argc, aa.argv);
596 * Try to change the current working directory into path.
599 chdir_verify_path(const char path[], char newpath[])
604 * Check if the path is a directory. If not fail without reporting
607 if (stat(path, &sb) < 0) {
608 return (NULL); /* fail but no report */
610 if (S_ISDIR(sb.st_mode) == 0) {
615 * The path refers to a directory, so we try to change into it. If we
616 * fail, or we fail to obtain the path from root to the directory,
617 * then report an error and fail.
619 if (chdir(path) < 0) {
620 warn("warning: %s", path);
623 if (getcwd(newpath, MAXPATHLEN) == NULL) {
624 warn("warning: %s", path);
631 * In lieu of a good way to prevent every possible looping in make(1), stop
632 * there from being more than MKLVL_MAXVAL processes forked by make(1), to
633 * prevent a forkbomb from happening, in a dumb and mechanical way.
636 * Creates or modifies enviornment variable MKLVL_ENVVAR via setenv().
639 check_make_level(void)
641 #ifdef WANT_ENV_MKLVL
642 char *value = getenv(MKLVL_ENVVAR);
643 int level = (value == NULL) ? 0 : atoi(value);
646 errc(2, EAGAIN, "Invalid value for recursion level (%d).",
648 } else if (level > MKLVL_MAXVAL) {
649 errc(2, EAGAIN, "Max recursion level (%d) exceeded.",
653 sprintf(new_value, "%d", level + 1);
654 setenv(MKLVL_ENVVAR, new_value, 1);
656 #endif /* WANT_ENV_MKLVL */
661 * The main function, for obvious reasons. Initializes variables
662 * and a few modules, then parses the arguments give it in the
663 * environment and on the command line. Reads the system makefile
664 * followed by either Makefile, makefile or the file given by the
665 * -f argument. Sets the .MAKEFLAGS PMake variable based on all the
666 * flags it has received by then uses either the Make or the Compat
667 * module to create the initial list of targets.
670 * If -q was given, exits -1 if anything was out-of-date. Else it exits
674 * The program exits when done. Targets are created. etc. etc. etc.
677 main(int argc, char **argv)
680 const char *machine_arch;
681 const char *machine_cpu;
682 Boolean outOfDate = TRUE; /* FALSE if all targets up to date */
685 char mdpath[MAXPATHLEN];
686 char obpath[MAXPATHLEN];
687 char cdpath[MAXPATHLEN];
688 char *cp = NULL, *start;
691 * Initialize file global variables.
694 noBuiltins = FALSE; /* Read the built-in rules */
695 forceJobs = FALSE; /* No -j flag */
699 * Initialize program global variables.
701 beSilent = FALSE; /* Print commands as executed */
702 ignoreErrors = FALSE; /* Pay attention to non-zero returns */
703 noExecute = FALSE; /* Execute all commands */
704 keepgoing = FALSE; /* Stop on error */
705 allPrecious = FALSE; /* Remove targets when interrupted */
706 queryFlag = FALSE; /* This is not just a check-run */
707 touchFlag = FALSE; /* Actually update targets */
708 usePipes = TRUE; /* Catch child output in pipes */
709 debug = 0; /* No debug verbosity, please. */
712 jobLimit = DEFMAXJOBS;
713 compatMake = FALSE; /* No compat mode */
719 * get rid of resource limit on file descriptors
723 if (getrlimit(RLIMIT_NOFILE, &rl) == -1) {
726 rl.rlim_cur = rl.rlim_max;
727 if (setrlimit(RLIMIT_NOFILE, &rl) == -1) {
733 * Get the name of this type of MACHINE from utsname
734 * so we can share an executable for similar machines.
735 * (i.e. m68k: amiga hp300, mac68k, sun3, ...)
737 * Note that while MACHINE is decided at run-time,
738 * MACHINE_ARCH is always known at compile time.
740 if ((machine = getenv("MACHINE")) == NULL) {
744 static struct utsname utsname;
746 if (uname(&utsname) == -1)
748 machine = utsname.machine;
752 if ((machine_arch = getenv("MACHINE_ARCH")) == NULL) {
754 machine_arch = MACHINE_ARCH;
756 machine_arch = "unknown";
761 * Set machine_cpu to the minumum supported CPU revision based
762 * on the target architecture, if not already set.
764 if ((machine_cpu = getenv("MACHINE_CPU")) == NULL) {
765 if (!strcmp(machine_arch, "i386"))
766 machine_cpu = "i386";
767 else if (!strcmp(machine_arch, "alpha"))
770 machine_cpu = "unknown";
774 * Initialize the parsing, directory and variable modules to prepare
775 * for the reading of inclusion paths and variable settings on the
780 Dir_Init(); /* Initialize directory structures so -I flags
781 * can be processed correctly */
782 Var_Init(environ); /* As well as the lists of variables for
783 * parsing arguments */
786 * Initialize various variables.
787 * MAKE also gets this name, for compatibility
788 * .MAKEFLAGS gets set to the empty string just in case.
789 * MFLAGS also gets initialized empty, for compatibility.
791 Var_SetGlobal("MAKE", argv[0]);
792 Var_SetGlobal(".MAKEFLAGS", "");
793 Var_SetGlobal("MFLAGS", "");
794 Var_SetGlobal("MACHINE", machine);
795 Var_SetGlobal("MACHINE_ARCH", machine_arch);
796 Var_SetGlobal("MACHINE_CPU", machine_cpu);
798 Var_SetGlobal("MAKE_VERSION", MAKE_VERSION);
802 * First snag things out of the MAKEFLAGS environment
803 * variable. Then parse the command line arguments.
805 Main_ParseArgLine(getenv("MAKEFLAGS"), 1);
807 MainParseArgs(argc, argv);
810 * Find where we are...
812 if (getcwd(curdir, MAXPATHLEN) == NULL)
818 if (stat(curdir, &sa) == -1)
819 err(2, "%s", curdir);
823 * The object directory location is determined using the
824 * following order of preference:
826 * 1. MAKEOBJDIRPREFIX`cwd`
828 * 3. PATH_OBJDIR.${MACHINE}
830 * 5. PATH_OBJDIRPREFIX`cwd`
832 * If one of the first two fails, use the current directory.
833 * If the remaining three all fail, use the current directory.
835 * Once things are initted,
836 * have to add the original directory to the search path,
837 * and modify the paths for the Makefiles apropriately. The
838 * current directory is also placed as a variable for make scripts.
840 if (!(pathp = getenv("MAKEOBJDIRPREFIX"))) {
841 if (!(path = getenv("MAKEOBJDIR"))) {
843 pathp = PATH_OBJDIRPREFIX;
844 snprintf(mdpath, MAXPATHLEN, "%s.%s", path, machine);
845 if (!(objdir = chdir_verify_path(mdpath, obpath)))
846 if (!(objdir=chdir_verify_path(path, obpath))) {
847 snprintf(mdpath, MAXPATHLEN,
848 "%s%s", pathp, curdir);
849 if (!(objdir=chdir_verify_path(mdpath,
854 else if (!(objdir = chdir_verify_path(path, obpath)))
858 snprintf(mdpath, MAXPATHLEN, "%s%s", pathp, curdir);
859 if (!(objdir = chdir_verify_path(mdpath, obpath)))
862 Dir_InitDot(); /* Initialize the "." directory */
863 if (objdir != curdir)
864 Path_AddDir(&dirSearchPath, curdir);
865 Var_SetGlobal(".DIRECTIVE_MAKEENV", "YES");
866 Var_SetGlobal(".ST_EXPORTVAR", "YES");
867 Var_SetGlobal(".CURDIR", curdir);
868 Var_SetGlobal(".OBJDIR", objdir);
870 if (getenv("MAKE_JOBS_FIFO") != NULL)
873 * Be compatible if user did not specify -j and did not explicitly
874 * turned compatibility on
876 if (!compatMake && !forceJobs)
880 * Initialize target and suffix modules in preparation for
881 * parsing the makefile(s)
890 * Set up the .TARGETS variable to contain the list of targets to be
891 * created. If none specified, make the variable empty -- the parser
892 * will fill the thing in with the default or .MAIN target.
894 if (Lst_IsEmpty(&create)) {
895 Var_SetGlobal(".TARGETS", "");
899 for (ln = Lst_First(&create); ln != NULL; ln = Lst_Succ(ln)) {
900 char *name = Lst_Datum(ln);
902 Var_Append(".TARGETS", name, VAR_GLOBAL);
908 * If no user-supplied system path was given (through the -m option)
909 * add the directories from the DEFSYSPATH (more than one may be given
910 * as dir1:...:dirn) to the system include path.
912 if (TAILQ_EMPTY(&sysIncPath)) {
913 char syspath[] = PATH_DEFSYSPATH;
915 for (start = syspath; *start != '\0'; start = cp) {
916 for (cp = start; *cp != '\0' && *cp != ':'; cp++)
919 Path_AddDir(&sysIncPath, start);
922 Path_AddDir(&sysIncPath, start);
928 * Read in the built-in rules first, followed by the specified
929 * makefile, if it was (makefile != (char *) NULL), or the default
930 * Makefile and makefile, in that order, if it wasn't.
934 Lst sysMkPath = Lst_Initializer(sysMkPath);
936 char defsysmk[] = PATH_DEFSYSMK;
938 Path_Expand(defsysmk, &sysIncPath, &sysMkPath);
939 if (Lst_IsEmpty(&sysMkPath))
940 Fatal("make: no system rules (%s).", PATH_DEFSYSMK);
941 LST_FOREACH(ln, &sysMkPath) {
942 if (!ReadMakefile(Lst_Datum(ln)))
946 Fatal("make: cannot open %s.", (char *)Lst_Datum(ln));
947 Lst_Destroy(&sysMkPath, free);
950 if (!Lst_IsEmpty(&makefiles)) {
953 LST_FOREACH(ln, &makefiles) {
954 if (!ReadMakefile(Lst_Datum(ln)))
958 Fatal("make: cannot open %s.", (char *)Lst_Datum(ln));
959 } else if (!ReadMakefile("BSDmakefile"))
960 if (!ReadMakefile("makefile"))
961 ReadMakefile("Makefile");
963 ReadMakefile(".depend");
965 /* Install all the flags into the MAKE envariable. */
969 if (((p = Var_Value(".MAKEFLAGS", VAR_GLOBAL)) != NULL) && *p)
970 setenv("MAKEFLAGS", p, 1);
974 * For compatibility, look at the directories in the VPATH variable
975 * and add them to the search path, if the variable is defined. The
976 * variable's value is in the same format as the PATH envariable, i.e.
977 * <directory>:<directory>:<directory>...
979 if (Var_Exists("VPATH", VAR_CMD)) {
981 * GCC stores string constants in read-only memory, but
982 * Var_Subst will want to write this thing, so store it
985 static char VPATH[] = "${VPATH}";
991 buf = Var_Subst(VPATH, VAR_CMD, FALSE);
993 vpath = Buf_Data(buf);
995 /* skip to end of directory */
996 for (ptr = vpath; *ptr != ':' && *ptr != '\0'; ptr++)
999 /* Save terminator character so know when to stop */
1003 /* Add directory to search path */
1004 Path_AddDir(&dirSearchPath, vpath);
1007 } while (savec != '\0');
1009 Buf_Destroy(buf, TRUE);
1013 * Now that all search paths have been read for suffixes et al, it's
1014 * time to add the default search path to their lists...
1018 /* print the initial graph, if the user requested it */
1022 /* print the values of any variables requested by the user */
1023 if (Lst_IsEmpty(&variables)) {
1025 * Since the user has not requested that any variables
1026 * be printed, we can build targets.
1028 * Have read the entire graph and need to make a list of targets
1029 * to create. If none was given on the command line, we consult
1030 * the parsing module to find the main target(s) to create.
1032 Lst targs = Lst_Initializer(targs);
1034 if (Lst_IsEmpty(&create))
1035 Parse_MainName(&targs);
1037 Targ_FindList(&targs, &create, TARG_CREATE);
1041 * Compat_Init will take care of creating
1042 * all the targets as well as initializing
1049 * Initialize job module before traversing
1050 * the graph, now that any .BEGIN and .END
1051 * targets have been read. This is done
1052 * only if the -q flag wasn't given (to
1053 * prevent the .BEGIN from being executed
1061 /* Traverse the graph, checking on all the targets */
1062 outOfDate = Make_Run(&targs);
1064 Lst_Destroy(&targs, NOFREE);
1067 Var_Print(&variables, expandVars);
1070 Lst_Destroy(&variables, free);
1071 Lst_Destroy(&makefiles, free);
1072 Lst_Destroy(&create, free);
1074 /* print the graph now it's been processed if the user requested it */
1078 if (queryFlag && outOfDate)