Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/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,我正在尝试使用构建目标的后缀而不是GNU make实现的“%”通配符语法编写一个可移植的makefile。这是我的Makefile: SUFFIXES = .xml.in .xml all: test.xml .xml.in.xml: echo "Hello" 运行make会给我“没有规则生成目标'test.xml'”。但是,如果使用通配符: all: test.xml %.xml: %.xml.in echo "Hello" 它起作用了。我假设我遇到问题是因为我的一个扩展中

我正在尝试使用构建目标的后缀而不是GNU make实现的“%”通配符语法编写一个可移植的makefile。这是我的Makefile:

SUFFIXES = .xml.in .xml
all: test.xml
.xml.in.xml:
    echo "Hello"
运行
make
会给我“没有规则生成目标'test.xml'”。但是,如果使用通配符:

all: test.xml
%.xml: %.xml.in
    echo "Hello"

它起作用了。我假设我遇到问题是因为我的一个扩展中有一个句点,是否有解决方法?

后缀=.xml.in.xml
->
.后缀:.xml.in.xml
。无论哪种方式,除非您需要支持make的古老版本,否则没有理由使用后缀规则而不是模式规则。您所说的“可移植”到底是什么意思?