Thread: contrib/spi makefile inconsistency

contrib/spi makefile inconsistency

From
Magnus Hagander
Date:
Hi!

contrib/spi has a Makefile that uses $(addsuffix) makefile rules for
DATA_built and DOCS. It's the only Makefile in contrib that does it.

I would like to change that to actually listing the modules instead. The
reason for that is that parsing the Makefile for the msvc build will be a
*lot* easier if I don't have to parse $addsuffix rules. And it's not like
it's complex modules it's building.

But I figured I'd post here for approval first. So - would a patch like the
attached be acceptable?

(Again, this only applies to contrib/SPI, I don't *expect* there to be more
such requirements for the other ones)

//Magnus


Attachment

Re: contrib/spi makefile inconsistency

From
Tom Lane
Date:
Magnus Hagander <magnus@hagander.net> writes:
> contrib/spi has a Makefile that uses $(addsuffix) makefile rules for
> DATA_built and DOCS. It's the only Makefile in contrib that does it.
> I would like to change that to actually listing the modules instead.

This seems like a definite regression in terms of writing the makefiles.
I'm not very happy about it --- just how much complexity are you saving
in the msvc support?  And have you looked at the other places where
addsuffix is already used?  (It looks like many of the contrib modules
rely on pgxs.mk's usages of addsuffix...)

            regards, tom lane

Re: contrib/spi makefile inconsistency

From
Peter Eisentraut
Date:
Magnus Hagander wrote:
> I would like to change that to actually listing the modules instead.
> The reason for that is that parsing the Makefile for the msvc build
> will be a *lot* easier if I don't have to parse $addsuffix rules.

Let's not open that can of worms.  Even if you think it's only a small
can.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

Re: contrib/spi makefile inconsistency

From
Magnus Hagander
Date:
On Thu, Mar 22, 2007 at 12:33:30PM -0400, Tom Lane wrote:
> Magnus Hagander <magnus@hagander.net> writes:
> > contrib/spi has a Makefile that uses $(addsuffix) makefile rules for
> > DATA_built and DOCS. It's the only Makefile in contrib that does it.
> > I would like to change that to actually listing the modules instead.
>
> This seems like a definite regression in terms of writing the makefiles.
> I'm not very happy about it --- just how much complexity are you saving
> in the msvc support?  And have you looked at the other places where
> addsuffix is already used?  (It looks like many of the contrib modules
> rely on pgxs.mk's usages of addsuffix...)

A grep shows that only spi/Makefile uses addsuffix...

(The rules in the pgxs makefiles are "emulated" and does the same
functionality, but I don't actuallyi *parse* the pgxs makefile)

But. Given the comments from you and Peter, I'll hold back on doing this
and attempt to parse it. For the current testing ("just get the darn tests
running"), I'll hard-code the spi exception in the msvc build code instead
- pending a proper parser for it.

//Magnus