我已经看过如何从make目标手动调用另一个目标?,但我的问题有点不同; 考虑这个例子(注意,stackoverflow.com将选项卡更改为显示中的空格;但如果您尝试编辑,则选项卡将保留在源代码中):
TEXENGINE=pdflatex
pdflatex:
echo the engine is $(TEXENGINE)
lualatex:
TEXENGINE=lualatex
echo Here I want to call the pdflatex rule, to check $(TEXENGINE) there!
Run Code Online (Sandbox Code Playgroud)
在这里,如果我运行默认目标(pdflatex),我得到预期的输出:
$ make pdflatex
echo the engine is pdflatex
the engine is pdflatex
Run Code Online (Sandbox Code Playgroud)
但是,有了目标lualatex,我想:
make变量更改TEXENGINE为lualatex,然后pdflatex(使用它)相同的代码.我怎么能这样做?
很明显,在我的lualatex规则中,我甚至没有设法更改TEXENGINE变量,因为我在尝试时得到了这个:
$ make lualatex
TEXENGINE=lualatex
echo Here I want to call the pdflatex rule, to check pdflatex there!
Here I want …Run Code Online (Sandbox Code Playgroud)