使用 scons 确定复杂构建的源文件列表 (*.[ch])
假设您有一个复杂的 C 项目源代码树,其中有很多目录和很多文件。 scons 构建支持多个目标(i386、sparc、powerpc)和多个变体(调试、发布)。根部有一个 sconstruct(引用各种 sconscripts),当使用指定目标和变体的参数(例如 scons target)调用时,它可以为所有这些做正确的事情=i386 变体=发布。
有没有一种简单的方法来确定每个构建将使用哪些源文件(*.c 和 *.h)(它们都略有不同)?我的理论是 scons 无论如何都需要计算这个文件集,以了解要编译哪些文件以及何时重新编译。可以提供这个信息吗?
我不想做的事情:
- 记录详细的构建并对其进行后处理(可能无论如何都不会告诉 *.h 文件)
find . -name '*.[ch]'
还打印不需要的文件以进行单元测试和其他杂乱,并且不是特定于目标的
理想情况下,我想做 scons target=i386variant=release printfileset
和查看 *.[ch] 文件的正确列表。然后,该列表可以作为进一步源文件修改工具(如 doxygen)的输入。
Suppose you have a complex source tree for a C project, lots of directories with lots of files. The scons build supports multiple targets (i386, sparc, powerpc) and multiple variants (debug, release). There's an sconstruct
at the root (referencing various sconscripts
) that does the right thing for all of these, when called with arguments specifying target and variant, e.g. scons target=i386 variant=release
.
Is there an easy way to determine which source files (*.c and *.h) each of these builds will use (they are all slightly different)? My theory is that scons needs to compute this file set anyway to know which files to compile and when to recompile. Can it provide this information?
What I do not want to do:
- Log a verbose build and postprocess it (probably wouldn't tell *.h files anyway)
find . -name '*.[ch]'
also prints unwanted files for unit testing and other cruft and is not target specific
Ideally I would like to do scons target=i386 variant=release printfileset
and see the proper list of *.[ch] files. This list could then serve as input for further source file munging tools like doxygen.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这里有几个问题都集中在一起:
当你把所有这些放在一起时,你最终会得到类似的结果:
There are a few questions all squashed together here:
When you put all of that together you end up with something like: