Skip to content

Commit

Permalink
Update metaprogramming.md
Browse files Browse the repository at this point in the history
Improve language, from `程序` to `命令`。`程序` seems improper in this context.
  • Loading branch information
DavidLee528 authored Sep 17, 2023
1 parent 08108cc commit dd4a24b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion _2020/metaprogramming.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ plot-%.png: %.dat plot.py
./plot.py -i $*.dat -o $@
```

这个文件中的指令,即如何使用右侧文件构建左侧文件的规则。或者,换句话说,冒号左侧的是构建目标,冒号右侧的是构建它所需的依赖。缩进的部分是从依赖构建目标时需要用到的一段程序。在 `make` 中,第一条指令还指明了构建的目的,如果您使用不带参数的 `make`,这便是我们最终的构建结果。或者,您可以使用这样的命令来构建其他目标:`make plot-data.png`。
这个文件中的指令,即如何使用右侧文件构建左侧文件的规则。或者,换句话说,冒号左侧的是构建目标,冒号右侧的是构建它所需的依赖。缩进的部分是从依赖构建目标时需要用到的一段命令。在 `make` 中,第一条指令还指明了构建的目的,如果您使用不带参数的 `make`,这便是我们最终的构建结果。或者,您可以使用这样的命令来构建其他目标:`make plot-data.png`。

规则中的 `%` 是一种模式,它会匹配其左右两侧相同的字符串。例如,如果目标是 `plot-foo.png`, `make` 会去寻找 `foo.dat` 和 `plot.py` 作为依赖。现在,让我们看看如果在一个空的源码目录中执行`make` 会发生什么?

Expand Down

0 comments on commit dd4a24b

Please sign in to comment.