Unix makefile errors " 'ake: Fatal error: Don't know how to make (c file here)"

Posted by gwenger on Stack Overflow See other posts from Stack Overflow or by gwenger
Published on 2010-02-17T00:59:43Z Indexed on 2010/03/27 23:33 UTC
Read the original article Hit count: 362

Filed under:
|
|
|

I've written the below makefile:

hw2p1: hw2p1_main.o hw2p1_getit.o hw2p1_parseit.o hw2p1_moveit.o hw2p1_showit.o
    gcc hw2p1_main.o hw2p1_getit.o hw2p1_parseit.o hw2p1_moveit.o hw2p1_showit.o
hw2p1_main.o: hw2p1_main.c
    gcc -c hw2p1_main.c
hw2p1_getit.o: hw2p1_getit.c
    gcc -c hw2p1_getit.c
hw2p1_parseit.o: hw2p1_parseit.c
    gcc -c hw2p1_parseit.c
hw2p1_moveit.o: hw2p1_moveit.c
    gcc -c hw2p1_moveit.c
hw2p1_showit.o: hw2p1_showit.c
    gcc -c hw2p1_showit.c

The first time I tried to call make, I got the error: "make: Fatal error: unexpected end of line seen" I deleted the blank lines between targets and called make again, but this time I got " 'ake: Fatal error: Don't know how to make hw2p1_main.c"

I've compiled all of these files separately and then linked them so I know that the errors are a result of an incorrect makefile and not a result of errors in my c files.

This is the first makefile that I've ever written so I might just be doing it completely incorrectly. Either way, any suggestions on how to get rid of these errors?

© Stack Overflow or respective owner

Related posts about c

    Related posts about gcc