【发布时间】:2015-07-28 16:21:09
【问题描述】:
我有一个大型遗留项目(C ANSI,90 年代初为 SCO/Xenix 编码,支持 POSIX)。该项目基于以下结构:
+ h (all common headers)
+ lutil1 (just .c source to build the library)
+ lutil2 (just .c source to build the library)
+ ...(more libs in the same structure)
|
+ moduleA (can have dependency to one or several libs)
| + several common .h
| + several common .c sources
| + moduleA-exe1.c (executable depending of some sources in this folder)
| + moduleA-exe2.c (executable depending of some sources in this folder)
| + ... (more executables, .c sources with main function)
|
+moduleB (can have dependency to one or several libs)
| + several common .h
| + several common .c sources
| + moduleB-exe1.c (executable depending of some sources in this folder)
| + moduleB-exe2.c (executable depending of some sources in this folder)
| + ... (more executables, .c sources with main function)
|
|...
每个模块可以有几十个可执行文件,其他的有很多常见的.c和很少的可执行文件。并且有几十个模块。
这个项目可以通过遗留脚本构建,但现在使用 gcc 和 gmake,但还不是很好,我们正在缓慢迁移,无需对结构进行大的修改以保持脚本正常工作。
现在,我们正在推广使用 IDE“带有 CDT 的 Eclipse”,而每个可执行文件一个项目的概念在这个项目中并不容易适应(查看模块组织)。
有没有办法将多个可执行文件源保存在同一个文件夹中,每个文件夹映射到多个 Eclipse 项目?欢迎提出更多建议。
注意:请记住,我们需要让旧脚本运行一段时间,直到我们确定新的组织/结构/技术可以有效地构建所有二进制文件。
【问题讨论】:
-
您坚持使用编辑器作为构建工具正在制造问题。为什么不改进现有的
make基础架构? (有关如何不使用 Make 的提示,请参阅 aegis.sourceforge.net/auug97.pdf) -
感谢制作纸。这是我几年前一直在寻找的东西。
-
如果你想看一看:PostgreSQL 有一个相当漂亮和干净的 (g)make build&install,即使使用 autoconf。旨在在不同的平台上工作。 (也适用于 Raspberry Pi!)
标签: c unix eclipse-cdt