Results 1 to 4 of 4
Hi
I am totally new to linux or makefile and what not. I have looked around for info about how to create a makefile to biuld a samll program and ...
- 03-03-2009 #1Just Joined!
- Join Date
- Mar 2009
- Posts
- 3
Makefile problem
Hi
I am totally new to linux or makefile and what not. I have looked around for info about how to create a makefile to biuld a samll program and here is what i produced:
all: lunar.o graphics.o
gcc -o lunar.o graphics.o
graphics.o: graphics.c graphics.h
gcc -o -c graphics.c
lunar.o: lunar.c graphics.h
gcc -o -c lunar.c
clean:
rm -f lunar.o graphics.o
lunar is the main.c program which calls upon graphics.h which calles upon graphics.c
I get Make ***(lunar.o) error 2 in the 'clean' function. Any ideas what's wrong with this makefile? Any help would be greatly appreciated.
Thanks
- 03-03-2009 #2- Lakshmipathi.G
-------------------
FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
-------------------
- 03-03-2009 #3Just Joined!
- Join Date
- Mar 2009
- Posts
- 3
Hi
Thanks for that advice, neither of those two things worked. I'm using eclipse as the debugger and what not and even when I remove the clean command it still highlights that area with the same error although lunar.o has been removed from there. I'm thinking that maybe it's not refreshing the makefile so I'll look into the eclipse editor and see what i can find. The advice was appreciated, if I can get the makefile to refresh possibly either of those two things will work. However if anyone has any more advice it would be gratefully received.
Thanks
- 03-03-2009 #4Just Joined!
- Join Date
- Mar 2009
- Posts
- 3
Hi
I managed to check that eclipse was refreshing and updating the makefile so it's not an eclipse problem. This being the case if anyone has any more suggestions about the makefile or if I should provide any more info to help resolve the problem please let me know.


Reply With Quote
