build - doubility-sky/daydayup GitHub Wiki
Build automation is the process of automating the creation of a software build and the associated processes including: compiling computer source code into binary code, packaging binary code, and running automated tests.
- 构建工具从 Make 到 Ninja
- C++构建系统的选择
- C++ 工程中常用的构建系统(Build System)
- 500 Lines or Less Contingent: A Fully Dynamic Build System
- 每条规则的形式
<target> : <prerequisites> [tab] <commands> -
order-only依赖,使用管道符号 '|' 分隔 常规依赖 和order-only依赖,order-only依赖通常用来创建目录。targets : normal-prerequisites | order-only-prerequisites - 伪目标
.PHONY,声明clean是"伪目标"之后,make就不会去检查是否存在一个叫做clean的文件,而是每次运行都执行对应的命令。.PHONY: clean clean: rm *.o temp
- 目标变量
<target ...> : variable-assignment - 自动变量
-
$@当前目标-
$(@D)和$(@F)分别指向$@的目录名和文件名 - 比如,
$@是src/input.c,那么$(@D)的值为src,$(@F)的值为input.c
-
-
$<第一个依赖-
$(<D)和$(<F)分别指向$<的目录名和文件名
-
-
$^所有依赖,但不包括order-only依赖 -
$?比目标更新的所有依赖,以空格分隔 -
$*指代匹配符%匹配的部分, 比如%匹配f1.txt中的f1,$*就表示f1
-
- Makefile简明教程
- Make 命令教程
- 跟我一起写Makefile
-
CMake
- CMake-tutorial
- cmake-examples Useful CMake Examples http://ttroy50.github.io/cmake-examples
- emake
- xmake, A cross-platform build utility based on lua.
- Awesome CMake: A curated list of awesome CMake resources, scripts, modules and examples.
