diff options
Diffstat (limited to 'usr.bin/make/main.c')
-rw-r--r-- | usr.bin/make/main.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c index 741c2f3..59dd8c8 100644 --- a/usr.bin/make/main.c +++ b/usr.bin/make/main.c @@ -253,7 +253,7 @@ ReadMakefile(const char p[]) if (!strcmp(fname, "-")) { Parse_File("(stdin)", stdin); - Var_Set("MAKEFILE", "", VAR_GLOBAL); + Var_SetGlobal("MAKEFILE", ""); } else { setMAKEFILE = strcmp(fname, ".depend"); @@ -314,7 +314,7 @@ ReadMakefile(const char p[]) */ found: if (setMAKEFILE) - Var_Set("MAKEFILE", MAKEFILE, VAR_GLOBAL); + Var_SetGlobal("MAKEFILE", MAKEFILE); Parse_File(fname, stream); fclose(stream); } @@ -360,7 +360,7 @@ rearg: err(1, "chdir %s", optarg); break; case 'D': - Var_Set(optarg, "1", VAR_GLOBAL); + Var_SetGlobal(optarg, "1"); MFLAGS_append("-D", optarg); break; case 'I': @@ -791,14 +791,14 @@ main(int argc, char **argv) * .MAKEFLAGS gets set to the empty string just in case. * MFLAGS also gets initialized empty, for compatibility. */ - Var_Set("MAKE", argv[0], VAR_GLOBAL); - Var_Set(MAKEFLAGS, "", VAR_GLOBAL); - Var_Set("MFLAGS", "", VAR_GLOBAL); - Var_Set("MACHINE", machine, VAR_GLOBAL); - Var_Set("MACHINE_ARCH", machine_arch, VAR_GLOBAL); - Var_Set("MACHINE_CPU", machine_cpu, VAR_GLOBAL); + Var_SetGlobal("MAKE", argv[0]); + Var_SetGlobal(MAKEFLAGS, ""); + Var_SetGlobal("MFLAGS", ""); + Var_SetGlobal("MACHINE", machine); + Var_SetGlobal("MACHINE_ARCH", machine_arch); + Var_SetGlobal("MACHINE_CPU", machine_cpu); #ifdef MAKE_VERSION - Var_Set("MAKE_VERSION", MAKE_VERSION, VAR_GLOBAL); + Var_SetGlobal("MAKE_VERSION", MAKE_VERSION); #endif /* @@ -845,8 +845,7 @@ main(int argc, char **argv) if (!(path = getenv("MAKEOBJDIR"))) { path = PATH_OBJDIR; pathp = PATH_OBJDIRPREFIX; - snprintf(mdpath, MAXPATHLEN, "%s.%s", - path, machine); + snprintf(mdpath, MAXPATHLEN, "%s.%s", path, machine); if (!(objdir = chdir_verify_path(mdpath, obpath))) if (!(objdir=chdir_verify_path(path, obpath))) { snprintf(mdpath, MAXPATHLEN, @@ -867,9 +866,9 @@ main(int argc, char **argv) Dir_InitDot(); /* Initialize the "." directory */ if (objdir != curdir) Path_AddDir(&dirSearchPath, curdir); - Var_Set(".ST_EXPORTVAR", "YES", VAR_GLOBAL); - Var_Set(".CURDIR", curdir, VAR_GLOBAL); - Var_Set(".OBJDIR", objdir, VAR_GLOBAL); + Var_SetGlobal(".ST_EXPORTVAR", "YES"); + Var_SetGlobal(".CURDIR", curdir); + Var_SetGlobal(".OBJDIR", objdir); if (getenv("MAKE_JOBS_FIFO") != NULL) forceJobs = TRUE; @@ -895,7 +894,9 @@ main(int argc, char **argv) * created. If none specified, make the variable empty -- the parser * will fill the thing in with the default or .MAIN target. */ - if (!Lst_IsEmpty(&create)) { + if (Lst_IsEmpty(&create)) { + Var_SetGlobal(".TARGETS", ""); + } else { LstNode *ln; for (ln = Lst_First(&create); ln != NULL; ln = Lst_Succ(ln)) { @@ -903,8 +904,7 @@ main(int argc, char **argv) Var_Append(".TARGETS", name, VAR_GLOBAL); } - } else - Var_Set(".TARGETS", "", VAR_GLOBAL); + } /* |