SCons:调用 Makefile 项目的构建
SCons 提供了 env.Command,理论上它应该能够在 Makefile 项目上调用 ./configure 和 make 。然而,我的理解是,Makefile 项目文件夹首先必须复制到 SCons 的构建目录中,因为构建过程不应更改源树中的任何内容。这怎么能做到呢?
我想我正在寻找的是这样的:
env.Command('lib/moo/Makefile', '', [Copy('BUILD_DIR/lib/moo', 'SOURCE_DIR/lib/moo', 'cd BUILD_DIR/lib/moo', './configure'])
虽然我怀疑有更好的方法来做到这一点。另外,上面命令中的 BUILD_DIR 和 SOURCE_DIR 应该用什么来代替?
谢谢 :-)
SCons provides env.Command which should theoretically be able to invoke ./configure and make on a Makefile project. However, my understanding is that the Makefile project folder would first have to be copied into SCons' build directory, since the build process should not be changing anything in the source tree. How can this be done?
I guess what I'm looking for is something like this:
env.Command('lib/moo/Makefile', '', [Copy('BUILD_DIR/lib/moo', 'SOURCE_DIR/lib/moo', 'cd BUILD_DIR/lib/moo', './configure'])
Although I suspect there is a better way of doing this. Also, what would go in place of BUILD_DIR and SOURCE_DIR in the above command?
Thanks :-)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
SCons Wiki 上有一些解决此问题的方法。也许其中之一足以满足您的需求:
There are a couple of recipes for this on the SCons Wiki. Maybe one of them will be good enough for your needs:
作为@kichik 的附录。如果您只想运行 make,请将以下内容添加到您的 SConscript 文件中:
这将调用此处描述的脚本 https://bitbucket.org/scons/scons/wiki/MakeBuilder
请注意,环境变量可能与预期不符,例如 PATH。这让我颇为头疼。
As an addendum to @kichik. If you only want to run make, add the following to your SConscript file:
This calls the script described here https://bitbucket.org/scons/scons/wiki/MakeBuilder
Please be aware that the Environment variables might not be as expected, e.g, PATH. This gave me quite a bit of a headache.