make-w32
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Windows-specific bug 11183


From: Alessandro Vesely
Subject: Re: Windows-specific bug 11183
Date: Tue, 01 Mar 2005 19:23:20 +0100

address@hidden wrote:
> 
> Here's a bug report with fix: is this something that we should accept or
> no?
> 
>   https://savannah.gnu.org/bugs/index.php?func=detailitem&item_id=11183
> 
> I don't know what the normal behavior of "\" in a pathname is when
> compiling for DOS/Windows.  The code in the bug may need to be enhanced
> because I think "\" is used to quote "%" in pattern rules.

I have this setup (win98's command.com - no sh.exe)

  D:\tmp\TOOLS\test>cat pt
  foo/%.a : foo\%.b
          @echo $@ : $^

  foo\\%.c : foo\%.d
          @echo $@ : $^

  foo\x : foo\y
          @echo $@ : $^

  D:\tmp\TOOLS\test>ls foo
  bar.b  bar.d  y

I can do this with yesterday's gmake:

  D:\tmp\TOOLS\test>c:\util\gmake -f pt foo\x
  foo\x : foo\y

  D:\tmp\TOOLS\test>c:\util\gmake -f pt foo/bar.a
  foo/bar.a : foo\bar.b

  D:\tmp\TOOLS\test>c:\util\gmake -f pt foo\bar.c
  C:\UTIL\GMAKE.EXE: *** No rule to make target `foo\bar.c'.  Stop.

Applying the patch

  D:\tmp\TOOLS\test>gmake -f pt foo\x
  foo\x : foo\y

  D:\tmp\TOOLS\test>gmake -f pt foo/bar.a
  foo/bar.a : foo\bar.b

  D:\tmp\TOOLS\test>gmake -f pt foo\bar.c
  foo\bar.c : foo\bar.d

Yes, it does require double backslashes somewhat inconsistently.
For consistency, one should use forward slashes and, for the few
utilities that reject them, apply $(subst /,\,$@) or similar. DOS
and Windows system calls have always accepted "/", in MS words:
"The application should use the backslash (\), the forward slash (/),
or both to separate components in a path" as mentioned in, e.g.,
http://msdn.microsoft.com/library/en-us/dnfiles/html/msdn_longfile.asp

The patch I applied is described in bug #11183:
D:\tmp\TOOLS\make>diff -wu make\implicit.c make-p\implicit.c
--- make\implicit.c     Mon Feb 28 08:48:22 2005
+++ make-p\implicit.c   Tue Mar 01 19:13:34 2005
@@ -350,7 +350,11 @@
                             && ((strchr (target, ']') == 0)
                                 && (strchr (target, ':') == 0));
 #else
-          check_lastslash = lastslash != 0 && strchr (target, '/') == 0;
+          check_lastslash = lastslash != 0 && strchr (target, '/') == 0
+#ifdef HAVE_DOS_PATHS
+            && strchr (target, '\\') == 0 /* and the "d:file"? */
+#endif
+          ;
 #endif
           if (check_lastslash)
             {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]