Conan: [question] Using -f flag for a makefile

Created on 5 Nov 2019  路  5Comments  路  Source: conan-io/conan

Hi!
I've been trying to package a library that uses makefiles but I can't find a way to specify the -f [file] flag for the make command.
I know that I can do self.run("make -f [file]) but it's a little hacky. is there a better way to do this using AutoToolsBuildEnvironment()?
Thanks!

question

All 5 comments

Hi @ericshub

Unfortunately there is no option available to do that. The possible solutions would be:

  • Use self.run() as you commented
  • Do a os.rename() of the file to name it "Makefile" before calling the AutoToolsBuildEnvironment. A bit of a workaround, but that might be very easy and effective.
  • Adding a filename argument to AutoToolsBuildEnvironment.make() might make sense and be relatively easy. Would you like to contribute it yourself in a Pull Request?

Thanks!

you may use:

env_build = AutoToolsBuildEnvironment(self.settings)
env_build.make(args=["-f", "custom_makefile"])

Oh, @SSE4 is right. I think that is a good solution, no need for the other workarounds or a custom parameter.

@ericshub please try it, and if it works, report and close this issue. Thanks!

I tried what @SSE4 suggested and it worked. Thanks!

you may use:

env_build = AutoToolsBuildEnvironment(self.settings)
env_build.make(args=["-f", "custom_makefile"])

Good! Thanks for telling!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tonka3000 picture tonka3000  路  3Comments

zomeck picture zomeck  路  3Comments

db4 picture db4  路  3Comments

mpdelbuono picture mpdelbuono  路  3Comments

petermbauer picture petermbauer  路  3Comments