[erlang-questions] Use of makefiles
Hal Snyder
drxyzzy@REDACTED
Fri Feb 29 17:40:29 CET 2008
I resisted this bikeshed issue as long as I could. :-)
I have seen make at the core of a build system for Erlang packages
that is used on a VoIP platform of several hundred servers.
So much of it was boilerplate that package Makefiles could be
completely generated - Erlang programmers didn't have to write a
single line of packaging goop.
Lots of people look at make the first time and say, urghh, how awful.
Part of it is the hazards of refactoring, as already pointed out.
When you factor out the generic and leave only the specific, what you
get does not look like the original complete picture.
But another thing that makes some refactored constructs tricky is
that different parts of a source file might be processed in different
passes (make, autoconf) or executed in different processes
(gen_servers, device drivers). There is probably a way to handle the
problem of mixed (implicit) contexts better.
On Feb 29, 2008, at 7:21 AM, Matthias Lang wrote:
> James> As much as I like Joe's book, the use of makefiles jumped
> James> at at me as clunky and outdated against the background of
> James> the other topics discussed in it. There are simpler
> James> options:
>
> Chandru> I don't agree that Makefiles are outdated. Clunky? Probably.
> ...
> Chandru> I personally am not very familiar with the Makefile syntax
> Chandru> but I don't think it would've been easy to achieve the same
> Chandru> results, in quite the same time, by rolling our own
> version of make.
>
> Makefiles are declarative, so in theory they should be really neat and
> the Erlang world should love them. There are two flies in the
> ointment. One is that the syntax is batshit crazy. The other is that
> people tend to force large doses of imperativeness into Makefiles,
> which defeats half the point. One widespread example is recursive
> makefiles.
>
> A while back, Bengt Kleberg pointed me at a paper titled "Recursive
> Make Sux" (ok, "Recursive Make Considered Harmful"). I got all
> inspired and spent a day or two changing our make system to something
> which wasn't recursive anymore. It got faster, didn't do unnecessary
> work and 'make clean' actually worked reliably, but it was still ugly
> as sin. At that point, my patience expired and I went back to doing
> interesting work.
>
> Make is so widespread that resistance is futile.
>
> Matthias
More information about the erlang-questions
mailing list