Home » Language IDEs » C / C++ IDE (CDT) » standard make shell `pwd`
standard make shell `pwd` [message #165446] |
Mon, 06 March 2006 12:04  |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
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 #165484 is a reply to message #165453] |
Wed, 08 March 2006 11:51   |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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
|
|
|
Goto Forum:
Current Time: Sun Jul 27 06:53:05 EDT 2025
Powered by FUDForum. Page generated in 0.05923 seconds
|