PDA

View Full Version : makefile



florian100
01-19-2009, 04:25 PM
hay
I have some problems with makefiles and I would appreciate any help
first:
I try to write a basic makefile which looks like
Code:

read_init: read_initCon.c
<tab>gcc -o read_init read_initCon.c -lm

but the result is not the compilation of my program but the second line is printed to the shell and thats it... if I delete -lm at the end, the compilation is working, but I need the link, so the compilation is not successful. Where is my mistake?

second: I have some Makefiles in a folder and they are named like galaxy.Makefile, cluster.Makefile etc. Does anybody know how I can execute this makefiles?
thanks for any help
best regards
florian

matsp
01-19-2009, 04:58 PM
Without knowing exactly what error you get, I can't really say what is going wrong in your simple makefile - it looks fine as posted.

If you want make to use a file not called Makefile or makefile, then


make -f somefilename

will do the job of using "somefilename" as the input file.

--
Mats

florian100
01-20-2009, 04:33 AM
thanks for the answer. I solved the problem with the makefile... just stupidity...:-)
best regards
florian