如何学习自动工具的喜悦? [英] How to learn the Joy of Autotools?

查看:74
本文介绍了如何学习自动工具的喜悦?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,几年前,我花了一些时间来研究make,它的回报很大.编写小的makefile来构建项目和自动执行任务既有趣又富有成效.

当然,缺点是我的makefile过于具体,尤其是在平台和库位置方面.

这就是人们告诉我抢险救援的自动工具"的时候了!而且,当其他人这样做时,它们似乎确实可以解决问题(我喜欢下载某些东西并运行configure && make && sudo make install并观看它的工作原理),但是我无法全神贯注于他们.

我已经查看了一些configure.acMakefile.am文件,但我只是不明白发生了什么.我不知道标识符的哪一部分是开发人员的选择,哪一部分对自动工具有意义.我不确定我是否了解整个流程和Makefile.in的要点.我想我正在碰到一个精神障碍,从我习惯的系统(make)到那之上的一两层.

任何人都可以将我引向可以教我自动工具乐趣的教程或书籍(最好不要过于干燥)吗?步骤是什么,如何使用它们,如何从头开始编写自己的configure.acMakefile.am?告诉我如何有效并与他们一起玩吗?

解决方案

尽管我认为elmarco的答案中提到的Alexandre Duret-Lutz的Autotools教程是最好的,但是您也应该了解山羊皮书:

http://sourceware.org/autobook/

它处理的工具的版本比较旧,但这是一个不错的介绍,并且按逻辑顺序显示.它也比教程更完整.在学习完本教程之后,最好将它用作补充阅读.

更新 还有约翰卡索特的书,该书于2010年8月左右出版,非常好.我不确定该链接是否整本书都在线,但至少有一部分是在线的.

So a couple years back I took some time to grok make, and it's paid off enormously. Writing little makefiles for building my projects and automating tasks is fun and productive.

The downside is, of course, that my makefiles are overspecific, especially when it comes to platforms and library locations.

So this is the point at which people tell me "autotools to the rescue!" And they certainly seem to do the trick when other people do them (I love downloading something and running configure && make && sudo make install and watching it just work), but I can't wrap my head around them.

I've looked in some configure.ac and Makefile.am files, and I just don't understand what's going on. I don't know what part of identifiers is developer's choice, and what part is meaningful to the autotools. I'm not sure I understand the entire flow and the point of Makefile.in. I think I'm just hitting a mental wall going from the system I'm used to (make) to something that's a layer or two above that.

Can anyone point me towards a tutorial or book (preferably not an overly dry one) that can teach me the joy of autotools? What the steps are, and how I can use them, how I can write my own configure.ac and Makefile.am from scratch? Show me how to be effective and have fun with them?

解决方案

Although I consider Alexandre Duret-Lutz's Autotools Tutorial, mentioned in elmarco's answer, to be the very best available, you should also know about the Goat Book:

http://sourceware.org/autobook/

The versions of the tools it deals with are rather old, but it's a nice introduction and it's presented in a logical order. It's also more complete than the Tutorial. It is perhaps best used as supplementary reading after you've worked through the Tutorial.

UPDATE There's also John Calcote's book, it was published around August 2010 and it's really good. I'm not sure whether the whole book is online at that link, but at least part of it is.

这篇关于如何学习自动工具的喜悦?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆