Re: Makefile for parser - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Makefile for parser
Date
Msg-id Pine.LNX.4.21.0007021307110.351-100000@localhost.localdomain
Whole thread Raw
In response to Re: Makefile for parser  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane writes:

> > On the topic of make, have you all read "Recursive Make Considered
> > Harmful" at http://www.tip.net.au/~millerp/rmch/recu-make-cons-harm.html
> 
> I read it, I don't believe a word of it.

Not only do I believe some words of it, I've had essentially the same
thoughts for quite a while. No, certainly there should not be a single
makefile for all of PostgreSQL. I'd certainly like to be able to do `make
-C src/bin/psql install'. But for the backend tree where you only build
one program this certainly would make sense. And note that the author's
example is essentially the same we've been talking about: a parse.h file
with incomplete dependencies.

> The whole thing is founded on a bogus example, to which is added
> specious reasoning and an assumption that everyone wants to use GCC as
> compiler

Well, you would need a compiler that handles -c and -o at the same time,
but you can always use cc -c && mv if that doesn't work. I think GNU make
might even do that by default, but I'd have to check.

> The Postgres build setup is certainly far from ideal, but IMHO the only
> thing *really* wrong with it is that we're not constructing accurate
> dependency lists by default.

Accurate dependencies are one thing, actually knowing how to satisfy these
dependencies is another. If the dependencies say that file X depends on
fmgroids.h but no further information about fmgroids.h is provided then it
will fail if it doesn't exist, or assume on mere existance that it is up
to date. This is again exactly what this guy is talking about.


Concluding, I don't know how well the suggested setup would work. I
haven't tried it, but I certainly will. In any case there's got to be
something better than maintaining 50+ makefiles that all do the same thing
and all do the same thing wrong.


-- 
Peter Eisentraut                  Sernanders väg 10:115
peter_e@gmx.net                   75262 Uppsala
http://yi.org/peter-e/            Sweden



pgsql-hackers by date:

Previous
From: Chris Bitmead
Date:
Subject: Re: [PATCHES] TABLEOID patch
Next
From: Peter Eisentraut
Date:
Subject: Re: Makefile for parser