I have created few files and Makefile in the same place.
I have read in below link about the special variables $@ and $< and used as so.
http://www.cs.colby.edu/maxwell/courses/tutorials/maketutor/
but when the say make i keep getting the error
gcc -o calc *.o
/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2/../../../crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
collect2: ld returned 1 exit status
make: *** [calc] Error 1
i have just started learning makefiles and understood basic makefile but using advance concepts is difficult.
%.o: %.c
gcc -c -o $@ $<
calc : *.o
gcc -o calc *.o
clean :
rm *.o