I've been writing my code in the Unix environment compiling with gcc and using gdb for debugging. I'm having problems with the - g option with gcc when I'm using a makefile. Consider the following makefile:
Code:
rbtree:main.o insert.o delete.o
gcc -lm -g -o rbtree main.o insert.o delete.o
main.o:main.c
gcc -c main.c -o main.o
delete.o:delete.c
gcc -c delete.c -o delete.o
insert.o:insert.c
gcc -c insert.c -o insert.o
clean:
rm -f core *.o rbtree
My program compiles fine, but when I run gdb to debug, there is no line number information in the file. ??? I can compile from the command line and all is well, but I'd like to be able to use the makefile. Anybody see anything terribly wrong that I'm doing. (i realize that I don't need the
Code:
gcc -c delete.c -o delete.o
for each target after rbtree, but is there anything else? Thanks,
jason