从介子执行 makefile 命令?

Executing a makefile command from meson?

我想尝试使用介子从 makefile 中自动执行 'make install' 命令。 我在 meson.build 文件中尝试了以下内容:

r = run_command('make install')

    if r.returncode() != 0
      # it failed
    endif
    output = r.stdout().strip()
    errortxt = r.stderr().strip()

但它打印出以下错误:Program or command 'make install' not found or not executable. 这个 meson.build 文件与我的 makefile 位于同一目录中。这不是使用此功能的方法还是有更好的方法来实现我想要做的事情?

第一个参数是命令(二进制),后面是它的参数:

run_command('make', 'install')