I'm attempting to define a Makefile that will take in a filename (eg. foo) as a variable from the command line, and then compile & link using gcc. So if I type make foo it will compile foo.c ,link up foo.o to the required libraries, and clean up the .o file. Here's my code so far, does anyone have any suggestions for where I'm going wrong?
@: [email protected]
@echo target is $@
gcc [email protected] -v -lmar -lbar -DDEBUG -o $@
rm [email protected]
[email protected]: [email protected]
gcc -c -v [email protected]