Problem with makefile in Cygwin

0

I have installed Cygwin. My problem is when I try to run a makefile which contains a line

gcc -g -c file.c

I get an error:

Fatal: Unable to execute command: gcc

At the same time when running this command from command line it works fine. What am I doing wrong?

UPDATE

The whole file:

CFLAGS  = -g
CC      =  gcc

file.o: file.c file.h
    $(CC) $(CFLAGS) -c file.c

Max

Posted 2011-05-08T16:41:41.430

Reputation: 123

Please show the rest of the make file. – ceving – 2011-05-08T16:54:01.890

@ceving I have updated my question – Max – 2011-05-08T17:19:18.853

1I thought it could be due to your Makefile having DOS line endings, but I just used your Makefile on my Cygwin installation with DOS line endings and with Unix line endings and it worked fine both ways. – garyjohn – 2011-05-08T18:59:40.037

Are you sure you're using Cygwin make? You can check with which make. – ak2 – 2011-05-08T19:36:08.333

@ak2 Thanks! That was the reason. After I installed cygwin make it worked. – Max – 2011-05-08T21:02:42.560

No answers