=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/make/main.c,v retrieving revision 1.75 retrieving revision 1.76 diff -c -r1.75 -r1.76 *** src/usr.bin/make/main.c 2007/07/30 09:39:18 1.75 --- src/usr.bin/make/main.c 2007/07/30 09:51:53 1.76 *************** *** 1,5 **** /* $OpenPackages$ */ ! /* $OpenBSD: main.c,v 1.75 2007/07/30 09:39:18 espie Exp $ */ /* $NetBSD: main.c,v 1.34 1997/03/24 20:56:36 gwr Exp $ */ /* --- 1,5 ---- /* $OpenPackages$ */ ! /* $OpenBSD: main.c,v 1.76 2007/07/30 09:51:53 espie Exp $ */ /* $NetBSD: main.c,v 1.34 1997/03/24 20:56:36 gwr Exp $ */ /* *************** *** 134,142 **** opt[0] = '-'; opt[1] = c; opt[2] = '\0'; ! Var_Append(MAKEFLAGS, opt, VAR_GLOBAL); if (arg != NULL) ! Var_Append(MAKEFLAGS, arg, VAR_GLOBAL); } static void --- 134,142 ---- opt[0] = '-'; opt[1] = c; opt[2] = '\0'; ! Var_Append(MAKEFLAGS, opt); if (arg != NULL) ! Var_Append(MAKEFLAGS, arg); } static void *************** *** 220,226 **** c = optend ? -1 : getopt(argc, argv, OPTFLAGS); switch (c) { case 'D': ! Var_Set(optarg, "1", VAR_GLOBAL); record_option(c, optarg); break; case 'I': --- 220,226 ---- c = optend ? -1 : getopt(argc, argv, OPTFLAGS); switch (c) { case 'D': ! Var_Set(optarg, "1"); record_option(c, optarg); break; case 'I': *************** *** 691,698 **** if (d.object != d.current) Dir_AddDir(dirSearchPath, d.current); ! Var_Set(".CURDIR", d.current, VAR_GLOBAL); ! Var_Set(".OBJDIR", d.object, VAR_GLOBAL); /* * Initialize various variables. --- 691,698 ---- if (d.object != d.current) Dir_AddDir(dirSearchPath, d.current); ! Var_Set(".CURDIR", d.current); ! Var_Set(".OBJDIR", d.object); /* * Initialize various variables. *************** *** 700,711 **** * .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(".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); /* * First snag any flags out of the MAKEFLAGS environment variable. --- 700,711 ---- * .MAKEFLAGS gets set to the empty string just in case. * MFLAGS also gets initialized empty, for compatibility. */ ! Var_Set("MAKE", argv[0]); ! Var_Set(".MAKE", argv[0]); ! Var_Set(MAKEFLAGS, ""); ! Var_Set("MFLAGS", ""); ! Var_Set("MACHINE", machine); ! Var_Set("MACHINE_ARCH", machine_arch); /* * First snag any flags out of the MAKEFLAGS environment variable. *************** *** 731,740 **** for (ln = Lst_First(create); ln != NULL; ln = Lst_Adv(ln)) { char *name = (char *)Lst_Datum(ln); ! Var_Append(".TARGETS", name, VAR_GLOBAL); } } else ! Var_Set(".TARGETS", "", VAR_GLOBAL); /* --- 731,740 ---- for (ln = Lst_First(create); ln != NULL; ln = Lst_Adv(ln)) { char *name = (char *)Lst_Datum(ln); ! Var_Append(".TARGETS", name); } } else ! Var_Set(".TARGETS", ""); /* *************** *** 747,753 **** read_all_make_rules(noBuiltins, &makefiles, &d); ! Var_Append("MFLAGS", Var_Value(MAKEFLAGS), VAR_GLOBAL); /* Install all the flags into the MAKEFLAGS env variable. */ if (((p = Var_Value(MAKEFLAGS)) != NULL) && *p) --- 747,753 ---- read_all_make_rules(noBuiltins, &makefiles, &d); ! Var_Append("MFLAGS", Var_Value(MAKEFLAGS)); /* Install all the flags into the MAKEFLAGS env variable. */ if (((p = Var_Value(MAKEFLAGS)) != NULL) && *p) *************** *** 844,850 **** char *name; if (!strcmp(fname, "-")) { ! Var_Set("MAKEFILE", "", VAR_GLOBAL); Parse_File(estrdup("(stdin)"), stdin); } else { if ((stream = fopen(fname, "r")) != NULL) --- 844,850 ---- char *name; if (!strcmp(fname, "-")) { ! Var_Set("MAKEFILE", ""); Parse_File(estrdup("(stdin)"), stdin); } else { if ((stream = fopen(fname, "r")) != NULL) *************** *** 873,879 **** * placement of the setting here means it gets set to the last * makefile specified, as it is set by SysV make. */ ! found: Var_Set("MAKEFILE", fname, VAR_GLOBAL); Parse_File(fname, stream); } return true; --- 873,879 ---- * placement of the setting here means it gets set to the last * makefile specified, as it is set by SysV make. */ ! found: Var_Set("MAKEFILE", fname); Parse_File(fname, stream); } return true;