1.make 后面不带参数 默认执行的是第一个目标,而不是default,如下:
$ make === test === $ cat Makefile test: @echo "=== test ===" default: @echo "=== default ===" deploy: @echo "=== deploy ===" clean: @echo "=== clean ==="
2.目标:前置条件 规律如下:
#这里满足规则1,deploy在最前面,所以make = make deploy $ make === clean === === deploy === #前置条件先跑 $ cat Makefile deploy:clean test: @echo "=== test ===" default: @echo "=== default ===" deploy: @echo "=== deploy ===" clean: @echo "=== clean ==="
3.目标:前置条件 多条件规律如下:
#前置的前置都需要先行 $ make === test === === clean === === deploy === $ cat Makefile deploy:clean clean:test test: @echo "=== test ===" default: @echo "=== default ===" deploy: @echo "=== deploy ===" clean: @echo "=== clean ===" $ make clean === test === === clean ===
标签:deploy,default,make,Makefile,echo,clean,规则,test From: https://www.cnblogs.com/CGCong/p/17202836.html