本文介绍了SCons:调用 Makefile 项目的构建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

SCons 提供了 env.Command,理论上应该能够在 Makefile 项目上调用 ./configurema​​ke.但是,我的理解是首先必须将 Makefile 项目文件夹复制到 SCons 的构建目录中,因为构建过程不应更改源树中的任何内容.这怎么办?

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'])

虽然我怀疑有更好的方法来做到这一点.另外,上面命令中的 BUILD_DIR 和 SOURCE_DIR 会用什么代替?

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?

谢谢:-)

推荐答案

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:

这篇关于SCons:调用 Makefile 项目的构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-16 05:44