0

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?

jgoeders
  • 1,886
  • 19
  • 25

2 Answers2

0

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.

Andrey Starodubtsev
  • 5,139
  • 3
  • 32
  • 46
0

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

DrM
  • 1,092
  • 1
  • 8
  • 11