希望将构建工具链从 bash/grep/sed/awk/(auto)make/configure 重新实现为更理智的东西(例如 boost.build 等)
我目前维护着几个盒子,里面装着松散相关的编码项目、数据库和存储库(从自制的 *nix 发行版到我的课堂笔记),由我自己和一些同样脸色苍白的书呆子朋友维护(所有这些都是聚宝盆)存储在 SVN 中)。
我们的绝大多数代码都是用 C/C++/汇编语言编写的(一些实用程序是用 python/perl/php 编写的,我们不是 java 的忠实粉丝),用 gcc 编译。我们的构建工具链通常由 make、bash、grep、sed 和 awk 的大杂烩组成。最近发现的 Makefile 几乎和它构建的程序一样长(以及每个人对我神秘的 sed 和 awking 的普遍焦虑),这促使我寻求一种不那么痛苦的构建系统。
目前,我遇到的最强候选者是 Boost Build/Bjam 作为 GNU make 的替代品,以及 python 作为我们与构建相关的 bash 脚本的替代品。还有其他值得研究的 C/C++/asm 构建系统吗?我已经浏览了许多替代方案,但除了 Boost 之外,我还没有找到任何由我所知道的名字开发的产品。
(我应该指出,从 svn 命令行工具(例如 svnversion)轻松提取信息的能力很重要,并且有足够的灵活性来像 c/c++ 项目一样轻松地配置 asm 项目的构建)
I currently maintain a few boxes that house a loosely related cornucopia of coding projects, databases and repositories (ranging from a homebrew *nix distro to my class notes), maintained by myself and a few equally pasty-skinned nerdy friends (all of said cornucopia is stored in SVN).
The vast majority of our code is in C/C++/assembly (a few utilities are in python/perl/php, we're not big java fans), compiled in gcc. Our build toolchain typically consists of a hodgepodge of make, bash, grep, sed and awk. Recent discovery of a Makefile nearly as long as the program it builds (as well as everyone's general anxiety with my cryptic sed and awking) has motivated me to seek a less painful build system.
Currently, the strongest candidate I've come across is Boost Build/Bjam as a replacement for GNU make and python as a replacement for our build-related bash scripts. Are there any other C/C++/asm build systems out there worth looking into? I've browsed through a number of make alternatives, but I haven't found any that are developed by names I know aside from Boost's.
(I should note that an ability to easily extract information from svn commandline tools such as svnversion is important, as well as enough flexibility to configure for builds of asm projects as easily as c/c++ projects)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我们最近开始在工作中使用 CMake。到目前为止我对此非常满意。
We've started using CMake here at work recently. I've been pretty happy with it so far.
scons 或
两者都是“跨平台” - 都可以在 Windows 和 Linux 上进行编译。
Cmake现在很流行(例如boost就使用它)。它为每个平台创建本机构建文件 - Makefiles(对于 Linux)、来自自定义文件(CMakeList.txt)的 VC++ 项目(对于 Visual Studio)。还可以创建 Eclipse 项目、KDevelop 项目等。由于它创建本机构建文件,因此您可以继续使用您所使用的所有功能。例如,Makefile 的 ccache/colorgcc/distcc 或 Visual Studio 的 Visual Assist X。
我们在我们的项目中使用它,并对它感到满意 - 自动依赖、简单的语法、健壮的构建。
Scons 是 python 基础系统,它自行执行构建。恕我直言,它不太受欢迎,而且对于大型项目来说仍然很慢。但对于中小型项目来说也许是一个不错的选择。
scons or cmake.
Both "cross platform" - enable compiling on Windows and Linux.
Cmake now very popular (for example boost uses it). It creates native build files for each platform - Makefiles (for Linux), VC++ projects (for Visual Studio) from custom files (CMakeList.txt). In can also create Eclipse projects, KDevelop projects etc. Since it creates native build files, you can continue using all features you're used for. For example, ccache/colorgcc/distcc for Makefiles or Visual Assist X for Visual Studio.
We use it our project and are happy with it - automatic dependencies, easy syntax, robust builds.
Scons is python bases system, which perform the builds by itself. It's IMHO less popular, and still slow for large project. But for msmall to medium project maybe good alternative.
您也可以使用基于 python 的构建系统 -- http://code.google.com/p /waf/
You could use python-based build system, too -- http://code.google.com/p/waf/