继续makefile的学习:
在之前程序的基础上,我们继续编写更加高端的makefile。
obj = main.o dep.o
dir = ./out
.PHONY : all
all : test.kg $(obj)
test.kg : $(obj)
cc -o test.kg $(obj)
.PHONY : fuck
fuck :
rm -rf *.kg $(obj)
.PHONY : install
install :
mkdir $(dir)
cp test.kg $(dir)
.PHONY : uninstall
uninstall :
rm -rf $(dir)
我们来解释一下:
.PHONY可以看做是一个操作吧,之后make all、make fuck等等