eclipse + cygwin

읏짜의 이미지

eclipse와 cygwin을 사용해서 makefile project를 빌드하려고 하는데 Makefile 안에
dir :=$(shell pwd)가 있어요
근데 cygwin을 쓰다보니까 dir을 출력해보면 /c/~~로 찍혀서 경로를 제대로 못찾아가는데
/c를 C:로 바꿀수 있나요?

chanik의 이미지

pwd 쓸 자리에 cygwin의 cygpath 명령을 함께 써서 아래와 같이 하면 어떤지요?

$ cat Makefile
#TOPDIR=$(shell cygpath -m `pwd`)
TOPDIR:=$(shell cygpath -m `pwd`)
 
all:
    @echo $(TOPDIR)
 
$ pwd
/d/test2
$ make
D:/test2

덤으로, 윈도우 cmd 창에서도 cygwin의 bin 디렉토리만 PATH에 추가하면 비슷하게 동작합니다.

D:\test2>set PATH=%PATH%;c:\cygwin\bin
D:\test2>make
D:/test2

이클립스와 연동할때도 잘 되는지는 모르겠네요.