我在Makefile中定义了以下目标
%/$(BINFILE_NAME).rom :%/main.riscv
这在我的本地计算机上运行,该计算机具有以下配置
make -v
GNU Make 4.2.1
lsb_release -a
No LSB modules are available.
Distributor ID: Linuxmint
Description: Linux Mint 20
Release: 20
Codename: ulyana
uname -a
Linux dyumnin 5.4.0-40-generic #44-Ubuntu SMP Tue Jun 23 00:01:04 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
但是在远程机器上,我看到构建失败,并显示以下错误消息
No rule to make target '/home/me/project/test/config/ts/rx_DELETEME/outdir/mem.rom', needed by 'default'. Stop.
远程端的配置是
make -v
GNU Make 4.1
lsb_release -a
Description: Ubuntu 18.04.4 LTS
uname -a
Linux foo_server 4.15.0-111-generic #112-Ubuntu SMP Thu Jul 9 20:32:34 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Make的两个版本之间是否有任何已知的更改可能会导致此错误?
发布于 2020-07-27 16:39:11
更可能的原因是您的远程系统上没有main.riscv
。下面演示了该效果:
all: foo.bar
%.bar : %.baz
touch $@
%.baz:
touch $@
输出:
touch foo.baz
touch foo.bar
rm foo.baz
在模式规则中,如果您取消了如何构造.baz
文件的知识,并且文件系统中也没有匹配的文件,则将警告依赖于它的目标,而不是缺少的.baz
:
all: foo.bar
%.bar : %.baz
touch $@
#%.baz:
# touch $@
结果:
make: *** No rule to make target 'foo.bar', needed by 'all'. Stop.
https://stackoverflow.com/questions/63119352
复制