Makefile中以.开头的目标是什么意思,后缀规则是如何different/similar的?

What's the meaning of targets in a Makefile that start with a ., and how is it different/similar to suffix rules?

在 Makefile 中,我看到了这个:

all: .made

# ... some other code

.made: $(Program) bashbug
    @echo "$(Program) last made for a $(Machine) running $(OS)" >.made

.made 规则是否为后缀规则:https://www.gnu.org/software/make/manual/make.html#Suffix-Rules

此外,是否所有带有目标的规则都在前面有一个 . 后缀规则?

否则,以.开头的目标意义何在?在 https://www.gnu.org/software/make/manual/make.html#How-Make-Works:

中似乎有这样的意义

By default, make starts with the first target (not targets whose names start with ‘.’).

但是没有提到它的意义

另外,如果是后缀规则,为什么.made可以作为all规则的前置条件呢? (没有提到后缀规则的目标可以作为其他规则的先决条件。)

P.S.: 这个问题与相关但不同。这个问题明确询问目标与 .和后缀规则的目标。

Is the .made rule a suffix rule

不,因为 .made 不是 "known suffix"。

Also, are all rules with targets that have a . in front suffix rules?

不,只有那些点后面的单词是 "known suffix":

您的前两个问题已由 https://www.gnu.org/software/make/manual/make.html#Suffix-Rules 回答:

Suffix rule definitions are recognized by comparing each rule’s target against a defined list of known suffixes. When make sees a rule whose target is a known suffix, this rule is considered a single-suffix rule. When make sees a rule whose target is two known suffixes concatenated, this rule is taken as a double-suffix rule.

在你的例子中 .made 是一个实际的文件名。您的 Makefile 有一个规则,即 creates/updates 文件:

#vvvv
.made: $(Program) bashbug
        @echo "$(Program) last made for a $(Machine) running $(OS)" >.made
#                                                                    ^^^^^

一切都很正常;它与任何其他名称的工作方式相同。

前导点的唯一意义是它按照惯例使文件 "hidden",即 ls 不会显示它(未指定 -a),普通 * 不会匹配它,等等