Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Makefile ';%的变量';在多个文件匹配中_Makefile - Fatal编程技术网

Makefile ';%的变量';在多个文件匹配中

Makefile ';%的变量';在多个文件匹配中,makefile,Makefile,我想从几个来源制作一个完整的文本文档(因为其中一个文件源发生了更改,我希望文档发生更改) 我必须通过我开发的翻译人员进行翻译。我想通过语言作为论据,让它更清晰 昨天深夜,我梦见一个这样的makefile #makefile # ... my_complete_doc.%.html: my_trans_exe header.%.html $(wildcard source/*.%.html) $< --language $(variable_for_%) > $@ #

我想从几个来源制作一个完整的文本文档(因为其中一个文件源发生了更改,我希望文档发生更改)

我必须通过我开发的翻译人员进行翻译。我想通过语言作为论据,让它更清晰

昨天深夜,我梦见一个这样的makefile

#makefile
# ...
my_complete_doc.%.html: my_trans_exe header.%.html $(wildcard source/*.%.html)
        $< --language $(variable_for_%) > $@
#生成文件
# ...
my_complete_doc.%.html:my_trans_exe头.%.html$(通配符源代码/*.%.html)
$<--language$(变量\u表示\u%)>$@
(?)它是否将
%
替换为具有自己的
头文件.language.html
文件的所有语言。当
source/*.language.html
中的一个文件发生更改时,文件
my\u completed\u doc.language.html
是否会立即更改


(?)。答案是使用“$*”自动变量:

my_complete_doc.%.html: my_trans_exe ...
    $< --language $* > $@

(注意$$)。在第一个-普通的扩展中,使“$$(…)”变为“$(…)”,第二个当“%”有一个值时,它扩展“$(…))。现在,如果修改任何文件,例如“代码>源代码/Fo.Deal.html”/代码>,将考虑文件<代码> MyAuthOrtheO.DOC。

.SECONDEXPANSION:
my_complete_doc.%.html: my_trans_exe header.%.html $$(wildcard source/*.%.html)
    $< --language $* > $@