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.144 2006/08/25 22:37:09 swildner 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"
88 extern char **environ; /* XXX what header declares this variable? */
92 * This control the default concurrency. On no occasion will more
93 * than DEFMAXJOBS targets be created at once.
98 /** ordered list of makefiles to read */
101 /** list of variables to print */
104 /** Targets to be made */
107 /** directories to search when looking for includes */
108 struct Path parseIncPath;
110 /** directories to search when looking for system includes */
111 struct Path sysIncPath;
113 bool expandVars; /* fully expand printed variables */
114 bool builtins; /* -r flag */
115 bool forceJobs; /* -j argument given */
119 * true if we aren't supposed to really make anything, just
120 * see if the targets are out-of-date
125 /* (-E) vars to override from env */
126 Lst envFirstVars = Lst_Initializer(envFirstVars);
128 bool allPrecious; /* .PRECIOUS given on line by itself */
129 bool beSilent; /* -s flag */
130 bool beVerbose; /* -v flag */
131 bool compatMake; /* -B argument */
132 int debug; /* -d flag */
133 bool ignoreErrors; /* -i flag */
134 int jobLimit; /* -j argument */
135 bool jobsRunning; /* true if the jobs might be running */
136 bool keepgoing; /* -k flag */
137 bool noExecute; /* -n flag */
138 bool touchFlag; /* -t flag */
139 bool usePipes; /* !-P flag */
140 uint32_t warn_cmd; /* command line warning flags */
141 uint32_t warn_flags; /* actual warning flags */
142 uint32_t warn_nocmd; /* command line no-warning flags */
144 time_t now; /* Time at start of make */
145 struct GNode *DEFAULT; /* .DEFAULT node */
149 * Exit with usage message.
155 "usage: make [-BPSXeiknqrstv] [-C directory] [-D variable]\n"
156 "\t[-d flags] [-E variable] [-f makefile] [-I directory]\n"
157 "\t[-j max_jobs] [-m directory] [-V variable]\n"
158 "\t[variable=value] [target ...]\n");
164 * Append a flag with an optional argument to MAKEFLAGS and MFLAGS
167 MFLAGS_append(const char *flag, char *arg)
171 Var_Append(".MAKEFLAGS", flag, VAR_GLOBAL);
173 str = MAKEFLAGS_quote(arg);
174 Var_Append(".MAKEFLAGS", str, VAR_GLOBAL);
178 Var_Append("MFLAGS", flag, VAR_GLOBAL);
180 str = MAKEFLAGS_quote(arg);
181 Var_Append("MFLAGS", str, VAR_GLOBAL);
187 * Open and parse the given makefile.
190 * true if ok. false if couldn't open file.
193 ReadMakefile(Parser *parser, CLI *cli, const char file[], const char curdir[], const char objdir[])
195 char path[MAXPATHLEN];
200 if (!strcmp(file, "-")) {
201 Parse_File(parser, cli, "(stdin)", stdin);
202 Var_SetGlobal("MAKEFILE", "");
206 if (strcmp(curdir, objdir) == 0 || file[0] == '/') {
210 * we've chdir'd, rebuild the path name
212 snprintf(path, MAXPATHLEN, "%s/%s", curdir, file);
214 #if THIS_BREAKS_THINGS
216 * XXX The realpath stuff breaks relative includes
217 * XXX in some cases. The problem likely is in
218 * XXX parse.c where it does special things in
219 * XXX ParseDoInclude if the file is relateive
220 * XXX or absolute and not a system file. There
221 * XXX it assumes that if the current file that's
222 * XXX being included is absolute, that any files
223 * XXX that it includes shouldn't do the -I path
224 * XXX stuff, which is inconsistant with historical
225 * XXX behavior. However, I can't pentrate the mists
226 * XXX further, so I'm putting this workaround in
227 * XXX here until such time as the underlying bug
230 if (realpath(path, path) == NULL) {
233 stream = fopen(path, "r");
236 stream = fopen(path, "r");
238 if (stream != NULL) {
239 if (strcmp(file, ".depend") != 0)
240 Var_SetGlobal("MAKEFILE", file);
241 Parse_File(parser, cli, path, stream);
246 /* look in -I and system include directories. */
247 fname = estrdup(file);
250 name = Path_FindFile(fname, &cli->parseIncPath);
252 name = Path_FindFile(fname, &cli->sysIncPath);
255 stream = fopen(name, "r");
256 if (stream != NULL) {
258 * set the MAKEFILE variable desired by System V fans
259 * -- the placement of the setting here means it gets
260 * set to the last makefile specified, as it is set
263 if (strcmp(file, ".depend") != 0)
264 Var_SetGlobal("MAKEFILE", name);
265 Parse_File(parser, cli, name, stream);
271 return (false); /* no makefile found */
275 * Read in the built-in rules first, followed by the specified
276 * makefiles or the one of the default makefiles. Finally .depend
280 ReadInputFiles(Parser *parser, CLI *cli, const char curdir[], const char objdir[])
283 char defsysmk[] = PATH_DEFSYSMK; /* Path of sys.mk */
284 Lst sysMkPath = Lst_Initializer(sysMkPath);
287 Path_Expand(defsysmk, &cli->sysIncPath, &sysMkPath);
288 if (Lst_IsEmpty(&sysMkPath))
289 Fatal("make: no system rules (%s).", PATH_DEFSYSMK);
291 LST_FOREACH(ln, &sysMkPath) {
292 char *name = Lst_Datum(ln);
293 if (!ReadMakefile(parser, cli, name, curdir, objdir))
294 Fatal("make: cannot open %s.", name);
296 Lst_Destroy(&sysMkPath, free);
299 if (!Lst_IsEmpty(&cli->makefiles)) {
302 LST_FOREACH(ln, &cli->makefiles) {
303 char *name = Lst_Datum(ln);
304 if (!ReadMakefile(parser, cli, name, curdir, objdir))
305 Fatal("make: cannot open %s.", name);
307 } else if (ReadMakefile(parser, cli, "BSDmakefile", curdir, objdir)) {
308 /* read BSDmakefile */
309 } else if (ReadMakefile(parser, cli, "makefile", curdir, objdir)) {
311 } else if (ReadMakefile(parser, cli, "Makefile", curdir, objdir)) {
314 /* No Makefile found */
317 ReadMakefile(parser, cli, ".depend", curdir, objdir);
323 * Handle argument to warning option.
326 Main_ParseWarn(const char *arg, int iscmd)
330 static const struct {
334 { "dirsyntax", WARN_DIRSYNTAX },
339 if (arg[0] == 'n' && arg[1] == 'o') {
344 for (i = 0; options[i].option != NULL; i++)
345 if (strcmp(arg, options[i].option) == 0)
348 if (options[i].option == NULL)
354 warn_cmd |= options[i].flag;
355 warn_nocmd &= ~options[i].flag;
356 warn_flags |= options[i].flag;
358 warn_nocmd |= options[i].flag;
359 warn_cmd &= ~options[i].flag;
360 warn_flags &= ~options[i].flag;
364 warn_flags |= (options[i].flag & ~warn_nocmd);
366 warn_flags &= ~(options[i].flag | warn_cmd);
374 * Parse a given argument vector. Called from main() and from
375 * Main_ParseArgLine() when the .MAKEFLAGS target is used.
377 * XXX: Deal with command line overriding .MAKEFLAGS in makefile
380 * Various global and local flags will be set depending on the flags
384 MainParseArgs(CLI *cli, int argc, char **argv)
387 bool found_dd = false;
390 optind = 1; /* since we're called more than once */
392 #define OPTFLAGS "ABC:D:E:I:PSV:Xd:ef:ij:km:nqrstvx:"
394 if ((optind < argc) && strcmp(argv[optind], "--") == 0) {
397 if ((c = getopt(argc, argv, OPTFLAGS)) == -1) {
404 MFLAGS_append("-A", NULL);
407 if (chdir(optarg) == -1)
408 err(1, "chdir %s", optarg);
411 Var_SetGlobal(optarg, "1");
412 MFLAGS_append("-D", optarg);
415 Path_AddDir(&cli->parseIncPath, optarg);
416 MFLAGS_append("-I", optarg);
419 Lst_AtEnd(&cli->variables, estrdup(optarg));
420 MFLAGS_append("-V", optarg);
423 cli->expandVars = false;
427 MFLAGS_append("-B", NULL);
428 unsetenv("MAKE_JOBS_FIFO");
432 MFLAGS_append("-P", NULL);
436 MFLAGS_append("-S", NULL);
439 char *modules = optarg;
441 for (; *modules; ++modules)
459 if (modules[1] == '1') {
460 debug |= DEBUG_GRAPH1;
463 else if (modules[1] == '2') {
464 debug |= DEBUG_GRAPH2;
487 warnx("illegal argument to d option "
491 MFLAGS_append("-d", optarg);
495 Lst_AtEnd(&envFirstVars, estrdup(optarg));
496 MFLAGS_append("-E", optarg);
499 checkEnvFirst = true;
500 MFLAGS_append("-e", NULL);
503 Lst_AtEnd(&cli->makefiles, estrdup(optarg));
507 MFLAGS_append("-i", NULL);
512 cli->forceJobs = true;
513 jobLimit = strtol(optarg, &endptr, 10);
514 if (jobLimit <= 0 || *endptr != '\0') {
515 warnx("illegal number, -j argument -- %s",
519 MFLAGS_append("-j", optarg);
524 MFLAGS_append("-k", NULL);
527 Path_AddDir(&cli->sysIncPath, optarg);
528 MFLAGS_append("-m", optarg);
532 MFLAGS_append("-n", NULL);
535 cli->queryFlag = true;
536 /* Kind of nonsensical, wot? */
537 MFLAGS_append("-q", NULL);
540 cli->builtins = false;
541 MFLAGS_append("-r", NULL);
545 MFLAGS_append("-s", NULL);
549 MFLAGS_append("-t", NULL);
553 MFLAGS_append("-v", NULL);
556 if (Main_ParseWarn(optarg, 1) != -1)
557 MFLAGS_append("-x", optarg);
570 * Parse the rest of the arguments.
571 * o Check for variable assignments and perform them if so.
572 * o Check for more flags and restart getopt if so.
573 * o Anything else is taken to be a target and added
574 * to the end of the "create" list.
576 for (; *argv != NULL; ++argv, --argc) {
577 if (Parse_IsVar(*argv)) {
578 char *ptr = MAKEFLAGS_quote(*argv);
580 Var_Append(".MAKEFLAGS", ptr, VAR_GLOBAL);
581 Parse_DoVar(*argv, VAR_CMD);
584 } else if ((*argv)[0] == '-') {
585 if ((*argv)[1] == '\0') {
587 * (*argv) is a single dash, so we
590 } else if (found_dd) {
592 * Double dash has been found, ignore
593 * any more options. But what do we do
594 * with it? For now treat it like a target.
596 Lst_AtEnd(&cli->create, estrdup(*argv));
599 * (*argv) is a -flag, so backup argv and
600 * argc. getopt() expects options to start
601 * in the 2nd position.
608 } else if ((*argv)[0] == '\0') {
609 Punt("illegal (null) argument.");
612 Lst_AtEnd(&cli->create, estrdup(*argv));
619 * Used by the parse module when a .MFLAGS or .MAKEFLAGS target
620 * is encountered and by main() when reading the .MAKEFLAGS envariable.
621 * Takes a line of arguments and breaks it into its
622 * component words and passes those words and the number of them to the
623 * MainParseArgs function.
624 * The line should have all its leading whitespace removed.
627 * Only those that come from the various arguments.
630 Main_ParseArgLine(CLI *cli, const char line[], int mflags)
635 MAKEFLAGS_break(&aa, line);
637 brk_string(&aa, line, true);
639 MainParseArgs(cli, aa.argc, aa.argv);
644 * Try to change the current working directory to path, and return
645 * the whole path using getcwd().
647 * @note for amd managed mount points we really should use pawd(1).
650 CheckDir(const char path[], char newdir[])
655 * Check if the path is a directory. If not fail without reporting
658 if (stat(path, &sb) < 0) {
661 if (S_ISDIR(sb.st_mode) == 0) {
666 * The path refers to a directory, so we try to change into it. If we
667 * fail, or we fail to obtain the path from root to the directory,
668 * then report an error and fail.
670 if (chdir(path) < 0) {
671 warn("warning: %s", path);
674 if (getcwd(newdir, MAXPATHLEN) == NULL) {
675 warn("warning: %s", path);
680 * Directory in path is accessable, newdir should now contain the
687 * Determine location of the object directory.
690 FindObjDir(const char machine[], char curdir[], char objdir[])
693 char newdir[MAXPATHLEN];
694 char mdpath[MAXPATHLEN];
698 * Find a path to where we are... [-C directory] might have changed
699 * our current directory.
701 if (getcwd(curdir, MAXPATHLEN) == NULL)
704 if (stat(curdir, &sa) == -1)
705 err(2, "%s", curdir);
708 * The object directory location is determined using the
709 * following order of preference:
711 * 1. MAKEOBJDIRPREFIX`cwd`
713 * 3. PATH_OBJDIR.${MACHINE}
715 * 5. PATH_OBJDIRPREFIX`cwd`
717 * If one of the first two fails, use the current directory.
718 * If the remaining three all fail, use the current directory.
720 if ((env = getenv("MAKEOBJDIRPREFIX")) != NULL) {
721 snprintf(mdpath, MAXPATHLEN, "%s%s", env, curdir);
722 if (CheckDir(mdpath, newdir)) {
723 strcpy(objdir, newdir);
726 strcpy(objdir, curdir);
730 if ((env = getenv("MAKEOBJDIR")) != NULL) {
731 if (CheckDir(env, newdir)) {
732 strcpy(objdir, newdir);
735 strcpy(objdir, curdir);
739 snprintf(mdpath, MAXPATHLEN, "%s.%s", PATH_OBJDIR, machine);
740 if (CheckDir(mdpath, newdir)) {
741 strcpy(objdir, newdir);
745 if (CheckDir(PATH_OBJDIR, newdir)) {
746 strcpy(objdir, newdir);
750 snprintf(mdpath, MAXPATHLEN, "%s%s", PATH_OBJDIRPREFIX, curdir);
751 if (CheckDir(mdpath, newdir)) {
752 strcpy(objdir, newdir);
756 strcpy(objdir, curdir);
760 * Initialize various make variables.
761 * MAKE also gets this name, for compatibility
762 * .MAKEFLAGS gets set to the empty string just in case.
763 * MFLAGS also gets initialized empty, for compatibility.
766 InitVariables(const char progname[])
769 const char *machine_arch;
770 const char *machine_cpu;
772 Var_SetGlobal("MAKE", progname);
773 Var_SetGlobal(".MAKEFLAGS", "");
774 Var_SetGlobal("MFLAGS", "");
776 Var_SetGlobal(".DIRECTIVE_MAKEENV", "YES");
777 Var_SetGlobal(".ST_EXPORTVAR", "YES");
779 Var_SetGlobal("MAKE_VERSION", MAKE_VERSION);
783 * Get the name of this type of MACHINE from utsname
784 * so we can share an executable for similar machines.
785 * (i.e. m68k: amiga hp300, mac68k, sun3, ...)
787 * Note that while MACHINE is decided at run-time,
788 * MACHINE_ARCH is always known at compile time.
790 if ((machine = getenv("MACHINE")) == NULL) {
794 static struct utsname utsname;
795 if (uname(&utsname) == -1)
797 machine = utsname.machine;
801 if ((machine_arch = getenv("MACHINE_ARCH")) == NULL) {
803 machine_arch = MACHINE_ARCH;
805 machine_arch = "unknown";
810 * Set machine_cpu to the minumum supported CPU revision based
811 * on the target architecture, if not already set.
813 if ((machine_cpu = getenv("MACHINE_CPU")) == NULL) {
814 if (!strcmp(machine_arch, "i386"))
815 machine_cpu = "i386";
817 machine_cpu = "unknown";
820 Var_SetGlobal("MACHINE", machine);
821 Var_SetGlobal("MACHINE_ARCH", machine_arch);
822 Var_SetGlobal("MACHINE_CPU", machine_cpu);
826 * Build targets given in the command line or if none were given
827 * use the main target determined by the parsing module.
833 Lst targs = Lst_Initializer(targs);
835 if (Lst_IsEmpty(&cli->create))
836 Parse_MainName(&targs);
838 Targ_FindList(&targs, &cli->create, TARG_CREATE);
840 /* Traverse the graph, checking on all the targets */
843 status = Compat_Run(&targs, cli->queryFlag);
846 status = Make_Run(&targs, cli->queryFlag);
849 Lst_Destroy(&targs, NOFREE);
855 * The main function, for obvious reasons. Initializes variables
856 * and a few modules, then parses the arguments give it in the
857 * environment and on the command line. Reads the system makefile
858 * followed by either Makefile, makefile or the file given by the
859 * -f argument. Sets the .MAKEFLAGS PMake variable based on all the
860 * flags it has received by then uses either the Make or the Compat
861 * module to create the initial list of targets.
864 * If -q was given, exits -1 if anything was out-of-date. Else it exits
868 * The program exits when done. Targets are created. etc. etc. etc.
871 main(int argc, char **argv)
876 int status; /* exit status */
877 char curdir[MAXPATHLEN]; /* startup directory */
878 char objdir[MAXPATHLEN]; /* where we chdir'ed to */
879 const char *make_flags;
881 /*------------------------------------------------------------*
882 * This section initializes stuff that require no input.
883 *------------------------------------------------------------*/
885 * Initialize program globals.
887 beSilent = false; /* Print commands as executed */
888 ignoreErrors = false; /* Pay attention to non-zero returns */
889 noExecute = false; /* Execute all commands */
890 keepgoing = false; /* Stop on error */
891 allPrecious = false; /* Remove targets when interrupted */
892 touchFlag = false; /* Actually update targets */
893 usePipes = true; /* Catch child output in pipes */
894 debug = 0; /* No debug verbosity, please. */
897 jobLimit = DEFMAXJOBS;
898 compatMake = false; /* No compat mode */
901 * Initialize program flags.
903 Lst_Init(&cli.makefiles);
904 Lst_Init(&cli.variables);
905 Lst_Init(&cli.create);
906 TAILQ_INIT(&cli.parseIncPath);
907 TAILQ_INIT(&cli.sysIncPath);
909 cli.expandVars = true;
910 cli.builtins = true; /* Read the built-in rules */
911 cli.queryFlag = false;
912 cli.forceJobs = false;
914 shell = Shell_Match(DEFSHELLNAME);
917 * Initialize the various modules.
920 commandShell = shell;
925 /*------------------------------------------------------------*
926 * This section initializes stuff that depend on things
927 * in the enviornment, command line, or a input file.
928 *------------------------------------------------------------*/
931 InitVariables(argv[0]);
934 * First snag things out of the MAKEFLAGS environment
935 * variable. Then parse the command line arguments.
937 if ((make_flags = getenv("MAKEFLAGS")) != NULL) {
938 Main_ParseArgLine(&cli, make_flags, 1);
940 MainParseArgs(&cli, argc, argv);
942 FindObjDir(Var_Value("MACHINE", VAR_GLOBAL), curdir, objdir);
943 Var_SetGlobal(".CURDIR", curdir);
944 Var_SetGlobal(".OBJDIR", objdir);
947 * Set up the .TARGETS variable to contain the list of targets to be
948 * created. If none specified, make the variable empty -- the parser
949 * will fill the thing in with the default or .MAIN target.
951 if (Lst_IsEmpty(&cli.create)) {
952 Var_SetGlobal(".TARGETS", "");
956 LST_FOREACH(ln, &cli.create) {
957 char *name = Lst_Datum(ln);
959 Var_Append(".TARGETS", name, VAR_GLOBAL);
963 Dir_CurObj(curdir, objdir);
966 * If no user-supplied system path was given (through the -m option)
967 * add the directories from the DEFSYSPATH (more than one may be given
968 * as dir1:...:dirn) to the system include path.
970 if (TAILQ_EMPTY(&cli.sysIncPath)) {
971 char syspath[] = PATH_DEFSYSPATH;
972 char *start = syspath;
975 while ((cp = strsep(&start, ":")) != NULL) {
976 Path_AddDir(&cli.sysIncPath, cp);
980 if (getenv("MAKE_JOBS_FIFO") != NULL)
981 cli.forceJobs = true;
984 * Be compatible if user did not specify -j and did not explicitly
985 * turned compatibility on
987 if (compatMake == false && cli.forceJobs == false)
993 parser.create = &cli.create;
994 parser.parseIncPath = &cli.parseIncPath;
995 parser.sysIncPath = &cli.sysIncPath;
997 ReadInputFiles(&parser, &cli, curdir, objdir);
999 /*------------------------------------------------------------*
1000 * We are finished processing inputs.
1001 *------------------------------------------------------------*/
1003 /* Install all the flags into the MAKE envariable. */
1007 p = Var_Value(".MAKEFLAGS", VAR_GLOBAL);
1008 if (p != NULL && *p != '\0') {
1009 if (setenv("MAKEFLAGS", p, 1) == -1)
1010 Punt("setenv: MAKEFLAGS: can't allocate memory");
1015 * For compatibility, look at the directories in the VPATH variable
1016 * and add them to the search path, if the variable is defined. The
1017 * variable's value is in the same format as the PATH envariable, i.e.
1018 * <directory>:<directory>:<directory>...
1020 if (Var_Value("VPATH", VAR_CMD) != NULL) {
1021 Buffer *buf = Var_Subst("${VPATH}", VAR_CMD, false);
1022 char *start = Buf_Data(buf);
1025 while ((cp = strsep(&start, ":")) != NULL) {
1026 Path_AddDir(&dirSearchPath, cp);
1029 Buf_Destroy(buf, true);
1033 * Now that all search paths have been read for suffixes et al, it's
1034 * time to add the default search path to their lists...
1038 /* print the initial graph, if the user requested it */
1042 if (Lst_IsEmpty(&cli.variables)) {
1043 status = BuildStuff(&cli);
1045 /* Print the values of variables requested by the user. */
1046 Var_Print(&cli.variables, cli.expandVars);
1050 * This should be a "don't care", we do not check
1051 * the status of any files. It might make sense to
1052 * modify Var_Print() to indicate that one of the
1053 * requested variables did not exist, and use that
1054 * as the return status.
1057 status = cli.queryFlag ? 1 : 0;
1060 /* print the graph now it's been processed if the user requested it */
1065 TAILQ_DESTROY(&cli.sysIncPath);
1066 TAILQ_DESTROY(&cli.parseIncPath);
1068 Lst_Destroy(&cli.create, free);
1069 Lst_Destroy(&cli.variables, free);
1070 Lst_Destroy(&cli.makefiles, free);