I have a make file that is not compiling correctly and I can not figure out why. Here is my file:
comp = gcc
comp_flags = -g -Wall
comp_libs = -lm
#comp = cc
lab6 : graph_support.o lab6.o
$(comp) $(comp_flags) graph_support.o lab6.o -o lab6 $(comp_libs)
graph.o : graph_support.c graph.h
$(comp) $(comp_flags) -c graph_support.c
lab6.o : lab6.c graph.h
$(comp) $(comp_flags) -c lab6.c
clean :
rm -f *.o lab6 core
Now here is what happens when I make it:
cc -c -o graph_support.o graph_support.c
gcc -g -Wall graph_support.o lab6.o -o lab6 -lm
The second one works correctly but the first one doesnt have the correct comp and comp_flags.
Any reason for this?