首页 > 解决方案 > `make` 中的 `docs` 关键字是什么以及为什么?

问题描述

我试图将文档生成添加到基本的 Makefile 中:

build: fmt docs
    # ...

docs:
    tfplugindocs

# ...
$ make docs
make: 'docs' is up to date.
$ tfplugindocs
[... does the business]

嗯,好的,编辑 Makefile:

build: fmt doc
    # ...

doc:
    tfplugindocs
$ make doc
[... does the business]

所以我假设docs是 CLI 或 Makefile 中的某种关键字;所以当我尝试将它用作“普通”目标的名称时,它并没有达到我的预期。但我在手册或帮助页面中找不到任何提及。

它有什么作用,如何使用,我应该使用它吗?

标签: makefilegnu-make

解决方案


推荐阅读