make会做什么

it is important to understand that make is sort of two languages in one. The
first language describes dependency graphs consisting of targets and
prerequisites. The second language is a macro language for performing textual
substitution.

make是两种语言的结合,一种是用来描述依赖关系的,一种是一个宏语言,用来进行字符串操作。

When make runs, it performs its job in two phases. In the first phase, make
reads the makefile and any included makefiles. At this time, variables and
rules are loaded into make’s internal database and the dependency graph is
created. In the second phase, make analyzes the dependency graph and
determines the targets that need to be updated, then executes command scripts
to perform the required updates.

当make运行时,它的工作分为两个阶段。第一阶段:make会读取makefile和它include的makefiles,在这是变量和规则被加载到make的内部数据库中,同时依赖关系图被建立起来。第二阶段:make会分析建立好的依赖图,然后来决定哪些targets需要更新,然后来执行对应target的命令来完成所需要的更新。

以上摘自:Managing Projects with GNU make, 3rd Edition