From ddd314349815de49582cf21adb160fcb3440481d Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Thu, 28 Jan 1993 23:01:01 +0000 Subject: [PATCH] Formerly variable.c.~18~ --- variable.c | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/variable.c b/variable.c index b77293f..9ff04c4 100644 --- a/variable.c +++ b/variable.c @@ -355,7 +355,7 @@ define_automatic_variables () /* This won't override any definition, but it will provide one if there isn't one there. */ v = define_variable ("SHELL", 5, default_shell, o_default, 0); - v->export = v_export; + v->export = v_export; /* Always export SHELL. */ /* Don't let SHELL come from the environment. */ if (*v->value == '\0' || v->origin == o_env || v->origin == o_env_override) @@ -368,6 +368,22 @@ define_automatic_variables () /* Make sure MAKEFILES gets exported if it is set. */ v = define_variable ("MAKEFILES", 9, "", o_default, 0); v->export = v_ifset; + + /* Define the magic D and F variables in terms of + the automatic variables they are variations of. */ + + define_variable ("@D", 2, "$(dir $@)", o_automatic, 1); + define_variable ("%D", 2, "$(dir $%)", o_automatic, 1); + define_variable ("*D", 2, "$(dir $*)", o_automatic, 1); + define_variable ("export) { case v_default: + if (v->origin == o_default || v->origin == o_automatic) + /* Only export default variables by explicit request. */ + continue; + if (!export_all_variables && v->origin != o_command && v->origin != o_env && v->origin != o_env_override @@ -495,11 +515,11 @@ target_environment (file) go back into the environment unchanged. */ if (v->recursive && v->origin != o_env && v->origin != o_env_override) - { - char *value = recursively_expand (v); - result[nvariables++] = concat (v->name, "=", value); - free (value); - } + { + char *value = recursively_expand (v); + result[nvariables++] = concat (v->name, "=", value); + free (value); + } else result[nvariables++] = concat (v->name, "=", v->value); } -- 2.7.4