SCons:将目标标记为已构建

时间:2013-08-15 20:34:22

标签: python scons

我有一个构建脚本,我无法控制构建所有内容(生成大量文件的shell命令),但大多数时候只需构建一些文件就足够了,而不是运行整个脚本。

我的SConstruct文件如下所示:

cmd1 = env.Command(<main executable file path>, [], <build everything shell command>)

cmd2 = env.Command(<target file path 1>, <source file path 1>, <build file 1>)
cmd3 = env.Command(<target file path 2>, <source file path 2>, <build file 2>)

我想要的是将cmd2和cmd2命令目标标记为已构建,如果构建了cmd1目标而没有实际构建它,是否可能?

1 个答案:

答案 0 :(得分:0)

你的意思是command1构建目标1和target2?

如果是这样的话,那真的回到了前面。

构建系统的想法是自下而上构建。它构建了你需要的每件作品,然后将所有作品组合在一起以获得更大的作品,等等。

它不包含一个巨大的脚本来构建所有内容和许多小脚本来部分构建大脚本构建的一些东西。

你应该考虑一些结构,如:

cmd2 = env.Command(<target file path 1>, <source file path 1>, <build command 1>)
cmd3 = env.Command(<target file path 2>, <source file path 2>, <build command 2>)
cmd1 = env.Command(<main executable file path>, [cmd2, cmd3], <link everything command>)
相关问题