Vahan
Vahan

Reputation: 168

Executing a makefile command from meson?

I wanted to try to execute 'make install' command from a makefile automatically with meson. I tried the following in a meson.build file:

r = run_command('make install')

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

But it prints the following error: Program or command 'make install' not found or not executable. This meson.build file is located in the same directory as my makefile. Is this not the way to use this functionality or is there a better way to acheive what I'm trying to do?

Upvotes: 1

Views: 1754

Answers (1)

user9706
user9706

Reputation:

The first argument is the command (binary) followed by its arguments:

run_command('make', 'install')

Upvotes: 2

Related Questions