allow the user's setting of MAKEOVERRIDES to affect MAKEFLAGS, so
a reference to this hidden variable is written instead. */
define_variable_cname ("MAKEOVERRIDES", "${-*-command-variables-*-}",
- o_env, 1);
+ o_default, 1);
#ifdef VMS
vms_export_dcl_symbol ("MAKEOVERRIDES", "${-*-command-variables-*-}");
#endif
/* If V is recursively expanded and didn't come from the environment,
expand its value. If it came from the environment, it should
- go back into the environment unchanged. */
- if (v->recursive && v->origin != o_env && v->origin != o_env_override)
+ go back into the environment unchanged... except MAKEFLAGS. */
+ if (v->recursive && ((v->origin != o_env && v->origin != o_env_override)
+ || streq (v->name, MAKEFLAGS_NAME)))
value = cp = recursively_expand_for_file (v, file);
/* If this is the SHELL variable remember we already added it. */
# -*-perl-*-
-$description = "The following test creates a makefile to ...";
-
-$details = "";
+$description = "Test the -e (environment overrides) option";
$ENV{GOOGLE} = 'boggle';
!,
'-e', "boggle\n");
+# Ensure variables set on the command line have the origin correct
+# See SV 61218
+
+run_make_test(q!
+$(info FOO [$(origin FOO)]: $(value FOO))
+all: ;
+recurse: ; @$(MAKE) -f #MAKEFILE#
+!,
+ '-e --no-print-directory FOO=1 recurse',
+ "FOO [command line]: 1\nFOO [command line]: 1\n#MAKE#[1]: 'all' is up to date.");
+
1;