Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » standard make shell `pwd`
standard make shell `pwd` [message #165446] Mon, 06 March 2006 12:04 Go to next message
Eclipse UserFriend
Originally posted by: andy.green.nospam.oxsemi.com

To Those In The Know,

I have an existing code base which compiles from cygwin command box. I
have installed eclipse 3.2.0 and cdt 3.0.2 and nearly got everything
building using standard make.

However, one feature in our code requires the makefile to get the
current working directory. If I build through the cygwin shell, I can
use any of `pwd`, $(PWD), $(shell pwd) and I get cygwin-style paths,
e.g. /home/andy/sources/blah.cpp.
If I compile through eclipse, I always end up with dos format
C:\cygwin\home\andy\sources\blah.cpp, which means I can't build.

How does this work? I assume eclipse must have its own shell and
implementation of pwd. Is there anything I can change to make it use
bash/tcsh/whatever, or just return the unix-style pwd I know and love?

Thanks in advance,
Andy
Re: standard make shell `pwd` [message #165453 is a reply to message #165446] Mon, 06 March 2006 13:09 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: andy.green.nospam.oxsemi.com

Andy Green wrote:
> To Those In The Know,
>
> I have an existing code base which compiles from cygwin command box. I
> have installed eclipse 3.2.0 and cdt 3.0.2 and nearly got everything
> building using standard make.
>
> However, one feature in our code requires the makefile to get the
> current working directory. If I build through the cygwin shell, I can
> use any of `pwd`, $(PWD), $(shell pwd) and I get cygwin-style paths,
> e.g. /home/andy/sources/blah.cpp.
> If I compile through eclipse, I always end up with dos format
> C:\cygwin\home\andy\sources\blah.cpp, which means I can't build.
>
> How does this work? I assume eclipse must have its own shell and
> implementation of pwd. Is there anything I can change to make it use
> bash/tcsh/whatever, or just return the unix-style pwd I know and love?
>


And further info, in case it helps:-

On a clean machine, the build works once. However at some point the pwd
changes from unix-style to dos-style, I think after the first time I
completed a make.

I did see this before on the first machine but thought I must have done
something, now I'm really curious...
Re: standard make shell `pwd` [message #165461 is a reply to message #165453] Wed, 08 March 2006 08:22 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: arne.anka.ginguppin.de

i can't help you with that -- but maybe you can help me ;-)
i got a large project developed in linux and would like to build it for
testing purposes in win -- but it is a qt-project with .pro files from
which the makefiles are generated.
those .pro files contain pathes for includes, libraries etc in
unix-notation (i e ../../foo/bar and /usr/lib/) -- am i right that i could
use those paths in a cygwin environment and thei are looked up correctly?
i do not need eclipse nor any ide, only make all on a teminal emulator ...
Re: standard make shell `pwd` [message #165469 is a reply to message #165461] Wed, 08 March 2006 08:55 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ccvural.ttnet.net.tr

arne anka wrote:
> i can't help you with that -- but maybe you can help me ;-)
> i got a large project developed in linux and would like to build it for
> testing purposes in win -- but it is a qt-project with .pro files from
> which the makefiles are generated.
> those .pro files contain pathes for includes, libraries etc in
> unix-notation (i e ../../foo/bar and /usr/lib/) -- am i right that i
> could use those paths in a cygwin environment and thei are looked up
> correctly?
> i do not need eclipse nor any ide, only make all on a teminal emulator ...

Cygwin and MSys (MinGW Shell) do want you need

CC Vural
Re: standard make shell `pwd` [message #165484 is a reply to message #165453] Wed, 08 March 2006 11:51 Go to previous messageGo to next message
Eclipse UserFriend
Andy Green wrote:
> Andy Green wrote:
>
>> To Those In The Know,
>>
>> I have an existing code base which compiles from cygwin command box. I
>> have installed eclipse 3.2.0 and cdt 3.0.2 and nearly got everything
>> building using standard make.
>>
>> However, one feature in our code requires the makefile to get the
>> current working directory. If I build through the cygwin shell, I can
>> use any of `pwd`, $(PWD), $(shell pwd) and I get cygwin-style paths,
>> e.g. /home/andy/sources/blah.cpp.
>> If I compile through eclipse, I always end up with dos format
>> C:\cygwin\home\andy\sources\blah.cpp, which means I can't build.
>>
>> How does this work? I assume eclipse must have its own shell and
>> implementation of pwd. Is there anything I can change to make it use
>> bash/tcsh/whatever, or just return the unix-style pwd I know and love?
>>
>
>
> And further info, in case it helps:-
>
> On a clean machine, the build works once. However at some point the pwd
> changes from unix-style to dos-style, I think after the first time I
> completed a make.
>
> I did see this before on the first machine but thought I must have done
> something, now I'm really curious...


Have you tried sending the path through cygpath - i.e.

cygpath -u `pwd` ?

dan
Re: standard make shell `pwd` [message #165508 is a reply to message #165484] Wed, 08 March 2006 16:08 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: andy.green.nospam.oxsemi.com

Daniel Sperka wrote:
> Andy Green wrote:
>
>> Andy Green wrote:
>>
>>> To Those In The Know,
>>>
>>> I have an existing code base which compiles from cygwin command box.
>>> I have installed eclipse 3.2.0 and cdt 3.0.2 and nearly got
>>> everything building using standard make.
>>>
>>> However, one feature in our code requires the makefile to get the
>>> current working directory. If I build through the cygwin shell, I can
>>> use any of `pwd`, $(PWD), $(shell pwd) and I get cygwin-style paths,
>>> e.g. /home/andy/sources/blah.cpp.
>>> If I compile through eclipse, I always end up with dos format
>>> C:\cygwin\home\andy\sources\blah.cpp, which means I can't build.
>>>
>>> How does this work? I assume eclipse must have its own shell and
>>> implementation of pwd. Is there anything I can change to make it use
>>> bash/tcsh/whatever, or just return the unix-style pwd I know and love?
>>>
>>
>>
>> And further info, in case it helps:-
>>
>> On a clean machine, the build works once. However at some point the
>> pwd changes from unix-style to dos-style, I think after the first time
>> I completed a make.
>>
>> I did see this before on the first machine but thought I must have
>> done something, now I'm really curious...
>
>
>
> Have you tried sending the path through cygpath - i.e.
>
> cygpath -u `pwd` ?
>
> dan


now there's a useful command I never know about! I reckon that will work
- although I'd still like to know about eclipse's internals - can anyone
give a brief synopsis on its shell, and cygwin awareness?
Re: standard make shell `pwd` [message #165669 is a reply to message #165508] Fri, 10 March 2006 02:26 Go to previous message
Eclipse UserFriend
Andy,

one thing I observed here is that eclipse opens a standard Windows shell
(not a cygwin shell) - when you are working on windows. So all your commands
will behave as if you had started them from a Windows shell. eclipse CDT is
not especially aware of any Cygwin installation. It will just launch a
"make" command and whatever. The sub-shell inherits the PATH from eclipse's
shell and whatever "make" is found there will be run in a Windows command
shell environment.

So maybe you can reproduce the behaviour of your makefile if you run make
from the Windows command prompt. This will not help you build your sources,
will just help you understand.

Interesting thing (which I never tried myself): What happens if you start
eclipse from a Cygwin shell ?

One fix, using cygpath, was already suggested.

You might also try to use "bash -c make" as builder command instead of just
saying "make". This would start make from a bash shell.

Hope this helps


Norbert Ploett
Previous Topic:Code completion templates
Next Topic:ARM Cross Development with Eclipse
Goto Forum:
  


Current Time: Sun Jul 27 06:53:05 EDT 2025

Powered by FUDForum. Page generated in 0.05923 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top