转义换行符是 POSIX make 的一部分吗?
Are escaped newlines part of POSIX make?
POSIX make 标准页面有关于转义换行符的说明(强调我的):
The treatment of escaped s throughout the makefile is historical practice. For example, the inference rule:
.c.o\
:
works, and the macro:
f= bar baz\
biz
a:
echo ==$f==
echoes "==bar baz biz=="
.
"historical practice" 是什么意思?
我能否在严格符合 POSIX 的 makefile 中使用转义换行符?
POSIX 标准关于转义换行符的说明(这是在实际的标准文本中,而不是在信息部分或理性部分):
When an escaped <newline> (one preceded by a <backslash>) is found
anywhere in the makefile except in a command line, an include line, or
a line immediately preceding an include line, it shall be replaced,
along with any leading white space on the following line, with a
single <space>. When an escaped <newline> is found in a command line
in a makefile, the command line shall contain the <backslash>, the
<newline>, and the next line, except that the first character of the
next line shall not be included if it is a <tab>. When an escaped
<newline> is found in an include line or in a line immediately
preceding an include line, the behavior is unspecified.
这是您在转义换行符方面所依赖的 POSIX 强制行为。
POSIX make 标准页面有关于转义换行符的说明(强调我的):
The treatment of escaped s throughout the makefile is historical practice. For example, the inference rule:
.c.o\ :
works, and the macro:
f= bar baz\ biz a: echo ==$f==
echoes
"==bar baz biz=="
.
"historical practice" 是什么意思?
我能否在严格符合 POSIX 的 makefile 中使用转义换行符?
POSIX 标准关于转义换行符的说明(这是在实际的标准文本中,而不是在信息部分或理性部分):
When an escaped <newline> (one preceded by a <backslash>) is found anywhere in the makefile except in a command line, an include line, or a line immediately preceding an include line, it shall be replaced, along with any leading white space on the following line, with a single <space>. When an escaped <newline> is found in a command line in a makefile, the command line shall contain the <backslash>, the <newline>, and the next line, except that the first character of the next line shall not be included if it is a <tab>. When an escaped <newline> is found in an include line or in a line immediately preceding an include line, the behavior is unspecified.
这是您在转义换行符方面所依赖的 POSIX 强制行为。