Some thoughts on the modularization effort

GOMBAS Gabor gombasg at sztaki.hu
Fri Apr 1 08:31:27 PST 2005


On Wed, Mar 30, 2005 at 07:49:25PM -0800, Kean Johnston wrote:

> Invariably, you end up with Makefiles that require GNU make.

Not unless you explicitely write constructs in Makefile.am that require
GNU make. GNU make however has some features that can be quite useful so
simply requiring GNU make might not be a bad idea.

> Now granted you dont use a debugger
> on Makefiles, but if something goes wrong, and some target isn't
> building correctly, or it doesn't pick up the right CFLAGS or
> whatever, you have to look at the Makefile. The stuff thats generated
> by automake is not *meant* to be human legible.

That's not as bad as it seems. I've looked into automake-generated
Makefiles quite a few times and they do have some very definite
advantages over hand-written Makefiles: they _all_ have the same
structure, they _all_ define the same things in the same order. If you
take your time and go through one automake-generated Makefile, you have
seen them all.

My personal experience is that it is a _lot_ easier to find a bug in
an automake-generated Makefile than in an equally complex hand-made make
system.

> One final "problem" with automake is its impact on source
> control. Its a small nit, I grant you, but it has caused more
> than one open source project I've worked on problems. You now
> have to maintain two files in your SCM.  You have to remember
> to regenerate them every time you check stuff in.

The solution is quite simple: you should NEVER add generated files to
the SCM (and it's true for every kind of generated file, not just
autoconf/automake).

> People get
> all inventive with SCM triggers to do it automatically, but
> that sometimes fails too. You have to be extremely careful about
> the machines that you use to generate source archives, and make
> sure that they have the exact right version of automake. You
> also have to make sure that every developer has the same version,
> and thats problematic.

You have to make sure to explicitely spell the minimum required version
of autocon/automake in configure.ac so older autoconf/automake will
simply print an error message and refuse to work.

Gabor

-- 
     ---------------------------------------------------------
     MTA SZTAKI Computer and Automation Research Institute
                Hungarian Academy of Sciences
     ---------------------------------------------------------


More information about the xorg-modular mailing list