example of Makefile to compile a c source file
****************************************************************************************
modify_time: modify_time.o
gcc -o modify_time modify_time.o
modify_time.o: modify_time.c # the prerequisite 'modify_time.c' CAN'T be omited!!!!! otherwise although modify_time.c modified, it will still prompt 'target is up-to-date' and the modification can't be compiled.
gcc -c modify_time.c
clean:
rm -rf *.o modify_time
****************************************************************************************
the below two lines in this Makefile can be omited:
modification can't be compiled.
gcc -c modify_time.c
在‘跟我一起写Makefile’中有一个Makefile编译多个c文件的例子。