Makefile

Status
Not open for further replies.
Well if you only have one source file it probably isn't worth using a makefile. As you can just as easily call the compiler.

To make the makefile anyways, here you go:

code:<HR>
Code:
<P>test: test.o
(tab)  gcc -o test test.o<P>test.o: test.c
(tab)  gcc -c test.c

Actually make it using make -f <makefilename>.

This will create an executable named test, and you can easily expand it to include multiple source files.

agent
 

dockeen

Ars Tribunus Militum
1,600
If memory serves, if you simply type "make", then the makefile it will use is the file named "makefile". The syntax you were given above is a little more flexible, as it shows you how to get "make" to use a makefile with another name.

From your error message, it looks like somehow you typed "makefile" when you meant to type "make".

Wayne (makefile making is still a dark art to me)
 
Status
Not open for further replies.