Makefile

2018-01-02  本文已影响16人  AEGQ

参考:


示例:


Makefile中的第一个目标会被作为其默认目标
.PHONY:clean
    当前目录不论是否有clean文件,make clean 都会执行Makefile中clean任务。
-n Print the commands that would be executed, but do not execute them.
target:prerequisites
      command
msg = "hello maker"                                      #变量

build: 
        # 注释会在控制台输出,相当于echo 
        @# 注释不会会在控制台输出,相当于关闭回声 
        -echh "出错,但继续执行下面指令"
        @echo ${msg}                                     #隐藏echo命令
        +echo “执行make -n时也会被执行”
test:build
        echo "test"
run:test
        echo "run"
clean:
        echo "clean"
上一篇 下一篇

猜你喜欢

热点阅读