什么是makefile?
Make 是一个构建自动化工具,如果存在Makefile 或 makefile 文件,会依据 Makefile 的构建规则去完成构建
makefile
.PHONY: build clean lint help
all: build lint clean help
build:
@echo "build"
lint:
@echo "lint"
clean:
@echo "clean"
help:
@echo "help"
echo "help"
make
输出结果:
build
lint
clean
help
echo "help"
help
执行make等于执行make all
执行make lint等于执行 @echo "lint"
make 默认会打印每条命令,再执行,这个行为被定义为回声
在对应命令前加上 @,可指定该命令不被打印到标准输出上
扩展阅读: