0
votes

I am experiencing different behavior when running make for a Cygwin C project in Eclipse vs the Cygwin shell.

The problem is that path names are being converted to windows paths.

My makefile:

all:
    pwd
    cd .; pwd

Running make in Cygwin shell (correct):

pwd
/cygdrive/c/myproject
cd .; pwd
/cygdrive/c/myproject

Running build in CDT (New Makefile Project from Existing Code, Cygwin toolchain):

make all 
pwd
/cygdrive/c/myproject
cd .; pwd
C:\myproject

It sees that using '.' (or '..') cause the path to be "converted" to a windows path. Any suggestions?

2
could you provide us some output?Thomas Ayoub
I have included the output of building under the cygwin shell and building from Eclipse. The flawed output is the line 'C:\myproject'jgoeders

2 Answers

0
votes

It's possible that compound command cd .; pwd is executing via shell subprocess, so this shell process may have different $PATH variable set. If there're another pwd in your $PATH, it will be called instead cygwin's one. For example, pwd from gnuwin32 prints windows' style paths.

0
votes

Two things, if you are gonna run scripts, use a shebang

#!/usr/bin/bash

Second, everything you need to know on this specific topic seems to be here, for free:

http://oreilly.com/catalog/make3/book/ch07.pdf

Use something similar to

cygpath `pwd`

instead