Makefile Make:多个$sign
从GNU make manual的第4.14节自动生成先决条件Makefile Make:多个$sign,makefile,Makefile,从GNU make manual的第4.14节自动生成先决条件 %.d: %.c @set -e; rm -f $@; \ $(CC) -M $(CPPFLAGS) $< > $@.$$$$; \ sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \ rm -f $@.$$$$ 因为这是一个awk程序,所以整个内容都被引用了。我把剩下的食
%.d: %.c
@set -e; rm -f $@; \
$(CC) -M $(CPPFLAGS) $< > $@.$$$$; \
sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
rm -f $@.$$$$
因为这是一个awk程序,所以整个内容都被引用了。我把剩下的食谱换成了。。。为什么它使用$
,而不是$
如有任何提示,我们将不胜感激。谢谢。$对shell和make以及awk都有意义。如果需要非make语义,则必须加倍以避免make语义 第二个例子很简单:它只是
$1
和$3
的awk语义
第一个是$$.$$的shell语义是:
$$
Process ID (PID) of the script itself. [5] The $$ variable often finds use in scripts to
construct "unique" temp file names (see Example 31-6, Example 16-31,
and Example 15-27). This is usually simpler than invoking mktemp.
快速引用。$对shell和make以及awk都有意义。如果需要非make语义,则必须加倍以避免make语义 第二个例子很简单:它只是
$1
和$3
的awk语义
第一个是$$.$$的shell语义是:
$$
Process ID (PID) of the script itself. [5] The $$ variable often finds use in scripts to
construct "unique" temp file names (see Example 31-6, Example 16-31,
and Example 15-27). This is usually simpler than invoking mktemp.
获取一个快速报价。如果你想在食谱中显示一个美元符号,你必须将其加倍(“$$”),手册在5.1.2中说。谢谢5.1.2中的手册说,如果你想在食谱中出现一个美元符号,你必须将其加倍(“$$”)。谢谢