summaryrefslogtreecommitdiff
path: root/variable.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2010-08-27 15:01:42 +0000
committerEli Zaretskii <eliz@gnu.org>2010-08-27 15:01:42 +0000
commitc3188c6f31620b4e8ec4d9d09255caaeb7032ff9 (patch)
treec136c9e831e85f83ead269057ed81e084a71f29c /variable.c
parent5acda13ace0ae4443ed04c4f8a62512b00a2b656 (diff)
downloadmake-c3188c6f31620b4e8ec4d9d09255caaeb7032ff9.tar.gz
variable.c (define_automatic_variables) [__MSDOS__ || WINDOWS32]:
Remove trailing backslashes in $(@D), $(<D), etc., for consistency with forward slashes. Fixes Savannah bug #30795.
Diffstat (limited to 'variable.c')
-rw-r--r--variable.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/variable.c b/variable.c
index 915be20..0d85546 100644
--- a/variable.c
+++ b/variable.c
@@ -917,7 +917,23 @@ define_automatic_variables (void)
define_variable_cname ("?D", "$(dir $?)", o_automatic, 1);
define_variable_cname ("^D", "$(dir $^)", o_automatic, 1);
define_variable_cname ("+D", "$(dir $+)", o_automatic, 1);
-#else
+#elif defined(__MSDOS__) || defined(WINDOWS32)
+ /* For consistency, remove the trailing backslash as well as slash. */
+ define_variable_cname ("@D", "$(patsubst %/,%,$(patsubst %\\,%,$(dir $@)))",
+ o_automatic, 1);
+ define_variable_cname ("%D", "$(patsubst %/,%,$(patsubst %\\,%,$(dir $%)))",
+ o_automatic, 1);
+ define_variable_cname ("*D", "$(patsubst %/,%,$(patsubst %\\,%,$(dir $*)))",
+ o_automatic, 1);
+ define_variable_cname ("<D", "$(patsubst %/,%,$(patsubst %\\,%,$(dir $<)))",
+ o_automatic, 1);
+ define_variable_cname ("?D", "$(patsubst %/,%,$(patsubst %\\,%,$(dir $?)))",
+ o_automatic, 1);
+ define_variable_cname ("^D", "$(patsubst %/,%,$(patsubst %\\,%,$(dir $^)))",
+ o_automatic, 1);
+ define_variable_cname ("+D", "$(patsubst %/,%,$(patsubst %\\,%,$(dir $+)))",
+ o_automatic, 1);
+#else /* not __MSDOS__, not WINDOWS32 */
define_variable_cname ("@D", "$(patsubst %/,%,$(dir $@))", o_automatic, 1);
define_variable_cname ("%D", "$(patsubst %/,%,$(dir $%))", o_automatic, 1);
define_variable_cname ("*D", "$(patsubst %/,%,$(dir $*))", o_automatic, 1);