This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Of vpath and win32 mode


Consider the following makefile:

vpath %c : ..\..\src

foo : foo.o
	$(CC) -o foo foo.o

foo.o : foo.c

If run make in Win32 mode then the path "..\..\src/foo.c" is used, which
causes some compilers (such as Microware's Ultra C (for OS-9000
development)) fits. Below you'll find a patch to vpath.c in the B19
version of make which affixes a backslash to the vpath generated
pathname when running in Win32 mode.

Share and enjoy.

	-tre

*** vpath.c.orig	Thu Dec 11 03:33:15 1997
--- vpath.c	Tue May 05 07:32:27 1998
***************
*** 24,33 ****
--- 24,37 ----
  #endif
  
  /* CYGNUS LOCAL: new scheme does not use a preprocessor define */
  extern char path_separator_char;
  
+ #ifdef __CYGWIN32__
+ extern int shell_mode;
+ #endif /* __CYGWIN32__ */
+ 
  /* Structure used to represent a selective VPATH searchpath.  */
  
  struct vpath
    {
      struct vpath *next;	/* Pointer to next struct in the linked
list.  */
***************
*** 453,463 ****
--- 457,474 ----
  	     higher levels.  */
  
  	  struct stat st;
  
  	  /* Put the slash back in NAME.  */
+ #ifdef __CYGWIN32__
+ 	  /* Some Win32 hosted compilers (e.g., Microware's Ultra C)
barf on
+ 		 filenames with forward slashes in them, so when running
in Win32
+ 		 mode use a back slash instead.  */
+ 	  *n = (shell_mode == WIN32_SHELL) ? '\\' : '/';
+ #else
  	  *n = '/';
+ #endif
  
  	  if (!exists_in_cache	/* Makefile-mentioned file need not
exist.  */
  	      || stat (name, &st) == 0) /* Does it really exist?  */
  	    {
  	      /* We have found a file.

--
Tom Emerson                                     Spyglass, Inc.
Software Engineer                    Cambridge Research Center
<mailto:tree@spyglass.com>           <http://www.spyglass.com>


-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]