I'm trying to run a simple makefile that looks like this:
T=-ansi -pedantic -Wall -Werror
a.out: test.o extra.o
gcc $(T) -c test.o extra.o
test.o: test.c test.h
gcc $(T) -c test.c
extra.o: extra.c extra.h
gcc $(T) -c extra.c
clean:
rm *.o a.out
But I seem to be getting warnings telling me that "linker input file unused because linking not done"
I tried removing the "-c" from the a.out directive, after the gcc, but that produced to give me more problems. I'm not sure how to go about proceeding from here, any ideas/input would be much appreciated.
EDIT: I'm running the program by "make -T", also removing the -c from a.out, causes the error" invalid symbol index"
make -Tis odd; what does that do? The 'invalid symbol index' suggests that you should remove all the.ofiles and run from the start again.make -Tdoesn't do that...whatever else it does. The T macro is fine; the usage of it is fine. Drop the-Tfrom the command line. (I note that GNUmake3.81 does not recognize-Tas a valid option. Either it is new or you are using a different variant ofmake.)