public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Using Visual C++ under Cygwin build system
@ 2000-10-03 13:07 Chad Loder
  2000-10-03 14:51 ` Matthew Smith
       [not found] ` <200010032207.e93M7bh18034@laxmls02.socal.rr.com>
  0 siblings, 2 replies; 6+ messages in thread
From: Chad Loder @ 2000-10-03 13:07 UTC (permalink / raw)
  To: cygwin

Hello. I am developing a build system using Cygwin (GNU make, bash,
etc.) on Windows 2000.

Some of our subsystems must be built using Visual C++. Obviously
Visual C++ will not understand paths like "/c/foo/bar.c" (where
/c is the Cygwin mounted C: drive). However, since GNU make will
be producing targets and processing prerequisites with precisely
those kinds of paths, I foresee problems.

Has anyone dealt with this problem before? Any suggestions
(or examples)?

Thanks,
	Chad


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Using Visual C++ under Cygwin build system
  2000-10-03 13:07 Using Visual C++ under Cygwin build system Chad Loder
@ 2000-10-03 14:51 ` Matthew Smith
       [not found] ` <200010032207.e93M7bh18034@laxmls02.socal.rr.com>
  1 sibling, 0 replies; 6+ messages in thread
From: Matthew Smith @ 2000-10-03 14:51 UTC (permalink / raw)
  To: cygwin, Chad Loder

> Hello. I am developing a build system using Cygwin (GNU make, bash,
> etc.) on Windows 2000.
>
> Some of our subsystems must be built using Visual C++. Obviously
> Visual C++ will not understand paths like "/c/foo/bar.c" (where
> /c is the Cygwin mounted C: drive). However, since GNU make will
> be producing targets and processing prerequisites with precisely
> those kinds of paths, I foresee problems.

Use the 'cygpath' program included with cygwin.  It will convert back and
forth between cygwin and windows paths.  An example of using this in a make
file would be like this:

RES_FILE := $(shell cygpath -w $(OBJ_DIR)/resource.o)

cheers,
-Matt Smith



--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Cygpath, backslashes, and sh.exe
       [not found]   ` <003101c02d8c$500db1c0$3c5350d8@guinness>
@ 2000-10-03 17:53     ` Chad Loder
  2000-10-03 17:57       ` DJ Delorie
  0 siblings, 1 reply; 6+ messages in thread
From: Chad Loder @ 2000-10-03 17:53 UTC (permalink / raw)
  To: cygwin

Hi all. Thanks for your help with cygpath (I *did* look in 
the FAQ, I just didn't know what to look for). :)

cygpath *seems* to be doing the right thing (it's hard
to tell), but there is some sort of problem with
backslashes. I have a rule like this:

%.obj : %.cpp
	$(CC) $(CPPFLAGS) $(shell cygpath -w $<)

The idea is that this will invoke sh.exe with something like:

 /c/VC98/bin/cl.exe /Fo:globref.obj c:\r7\jni\src\globref.cpp

But instead it seems to do:

 /c/VC98/bin/cl.exe /Fo:globref.obj c:r7jnisrcglobref.cpp

which causes the compiler to bomb out with:

 fatal error C1083: Cannot open source file: 'c:r7jnisrcglobref.cpp': No
such file or  directory

I figured I need to escape the backslashes before passing them
to a shell command. So I tried things like:

%.obj : %.cpp
	$(CC) $(CPPFLAGS) $(subst,\\,\\\\,$(shell cygpath -w $<))

but the subst function seems to just return an empty string (this
happens even when I use something without backslashes,
like $(subst,a,b,whatever).

Has anyone run into this?

Thanks,
	c

	c

At 05:50 PM 10/3/2000 -0500, you wrote:
>Chad:
>
>    Hey, no problem.  Let me know if you run into other problems.  My
>company uses it's own make system under cygwin as well.  We also use Visual
>C++ as the compiler.
>
>cheers,
>-Matt



--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Cygpath, backslashes, and sh.exe
  2000-10-03 17:53     ` Cygpath, backslashes, and sh.exe Chad Loder
@ 2000-10-03 17:57       ` DJ Delorie
  2000-10-03 18:01         ` Chad Loder
  0 siblings, 1 reply; 6+ messages in thread
From: DJ Delorie @ 2000-10-03 17:57 UTC (permalink / raw)
  To: cloder; +Cc: cygwin

> %.obj : %.cpp
> 	$(CC) $(CPPFLAGS) $(shell cygpath -w $<)

Try this:

%.obj : %.cpp
	$(CC) $(CPPFLAGS) '$(shell cygpath -w $<)'

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Cygpath, backslashes, and sh.exe
  2000-10-03 17:57       ` DJ Delorie
@ 2000-10-03 18:01         ` Chad Loder
  0 siblings, 0 replies; 6+ messages in thread
From: Chad Loder @ 2000-10-03 18:01 UTC (permalink / raw)
  To: DJ Delorie; +Cc: cygwin

That did the trick! Now on to the next problem.

"Is life always this hard, or just when you're
 a kid?" :)

Thanks,
	c	

At 08:56 PM 10/3/2000 -0400, you wrote:
>
>> %.obj : %.cpp
>> 	$(CC) $(CPPFLAGS) $(shell cygpath -w $<)
>
>Try this:
>
>%.obj : %.cpp
>	$(CC) $(CPPFLAGS) '$(shell cygpath -w $<)'
>
>--
>Want to unsubscribe from this list?
>Send a message to cygwin-unsubscribe@sourceware.cygnus.com
> 


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: Cygpath, backslashes, and sh.exe
@ 2000-10-03 19:27 Scott Carter
  0 siblings, 0 replies; 6+ messages in thread
From: Scott Carter @ 2000-10-03 19:27 UTC (permalink / raw)
  To: 'cygwin@sourceware.cygnus.com'; +Cc: 'Chad Loder'

I don't know if you tried to use it this way, or if you just typed it
incorrectly in your email, but the syntax of the subst function is
incorrect. There should not be a comma immediately after subst.

wrong: $(subst,\\,\\\\,$(shell cygpath -w $<))
right: $(subst \\,\\\\,$(shell cygpath -w $<))

Scott Carter

-----Original Message-----
From: Chad Loder [ mailto:cloder@acm.org ]
Sent: Tuesday, October 03, 2000 06:55 PM
To: cygwin@sourceware.cygnus.com
Subject: Cygpath, backslashes, and sh.exe


Hi all. Thanks for your help with cygpath (I *did* look in 
the FAQ, I just didn't know what to look for). :)

cygpath *seems* to be doing the right thing (it's hard
to tell), but there is some sort of problem with
backslashes. I have a rule like this:

%.obj : %.cpp
	$(CC) $(CPPFLAGS) $(shell cygpath -w $<)

The idea is that this will invoke sh.exe with something like:

 /c/VC98/bin/cl.exe /Fo:globref.obj c:\r7\jni\src\globref.cpp

But instead it seems to do:

 /c/VC98/bin/cl.exe /Fo:globref.obj c:r7jnisrcglobref.cpp

which causes the compiler to bomb out with:

 fatal error C1083: Cannot open source file: 'c:r7jnisrcglobref.cpp': No
such file or  directory

I figured I need to escape the backslashes before passing them
to a shell command. So I tried things like:

%.obj : %.cpp
	$(CC) $(CPPFLAGS) $(subst,\\,\\\\,$(shell cygpath -w $<))

but the subst function seems to just return an empty string (this
happens even when I use something without backslashes,
like $(subst,a,b,whatever).

Has anyone run into this?

Thanks,
	c

	c

At 05:50 PM 10/3/2000 -0500, you wrote:
>Chad:
>
>    Hey, no problem.  Let me know if you run into other problems.  My
>company uses it's own make system under cygwin as well.  We also use Visual
>C++ as the compiler.
>
>cheers,
>-Matt



--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2000-10-03 19:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-10-03 13:07 Using Visual C++ under Cygwin build system Chad Loder
2000-10-03 14:51 ` Matthew Smith
     [not found] ` <200010032207.e93M7bh18034@laxmls02.socal.rr.com>
     [not found]   ` <003101c02d8c$500db1c0$3c5350d8@guinness>
2000-10-03 17:53     ` Cygpath, backslashes, and sh.exe Chad Loder
2000-10-03 17:57       ` DJ Delorie
2000-10-03 18:01         ` Chad Loder
2000-10-03 19:27 Scott Carter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).