Re: PostgreSQL 9.3 beta breaks some extensions "make install" - Mailing list pgsql-hackers

From Cédric Villemain
Subject Re: PostgreSQL 9.3 beta breaks some extensions "make install"
Date
Msg-id 201305141639.07811.cedric@2ndquadrant.com
Whole thread Raw
In response to Re: PostgreSQL 9.3 beta breaks some extensions "make install"  (Marti Raudsepp <marti@juffo.org>)
Responses Re: PostgreSQL 9.3 beta breaks some extensions "make install"  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
Le mardi 14 mai 2013 10:17:13, Marti Raudsepp a écrit :
> On Tue, May 14, 2013 at 5:27 AM, Peter Eisentraut <peter_e@gmx.net> wrote:
> > On Tue, 2013-05-14 at 04:12 +0300, Marti Raudsepp wrote:
> >> It's caused by this common pattern in extension makefiles:
> >> DATA = $(wildcard sql/*--*.sql) sql/$(EXTENSION)--$(EXTVERSION).sql
> >
> > What is the point of this?  Why have the wildcard and then the
> > non-wildcard term?
>
> Because the non-wildcard file is built by the same Makefile (it's
> copied from the sql/$(EXTENSION).sql file). If it wasn't there, a
> "make install" from a clean checkout would miss this file.
>
> all: sql/$(EXTENSION)--$(EXTVERSION).sql
>
> sql/$(EXTENSION)--$(EXTVERSION).sql: sql/$(EXTENSION).sql
>         cp $< $@

There is also something else here, the addition of the all:.... target.

I believe it should be removed and the added target(s) be written after the
include of pgxs makefile.

If I follow your example, then I would rewrite http://manager.pgxn.org/howto

From
=====
PG91 = $(shell $(PG_CONFIG) --version | grep -qE " 8\.| 9\.0" && echo no ||
echo yes)

ifeq ($(PG91),yes)
all: sql/$(EXTENSION)--$(EXTVERSION).sql

sql/$(EXTENSION)--$(EXTVERSION).sql: sql/$(EXTENSION).sql   cp $< $@

DATA = $(wildcard sql/*--*.sql) sql/$(EXTENSION)--$(EXTVERSION).sql
EXTRA_CLEAN = sql/$(EXTENSION)--$(EXTVERSION).sql
endif

PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
====

To

====
PG91  = $(shell $(PG_CONFIG) --version | grep -qE " 8\.| 9\.0" && echo no ||
echo yes)

ifeq ($(PG91),yes)
DATA = $(wildcard sql/*--*.sql) sql/$(EXTENSION)--$(EXTVERSION).sql
EXTRA_CLEAN = sql/$(EXTENSION)--$(EXTVERSION).sql
endif

PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)

ifeq ($(PG91),yes)
sql/$(EXTENSION)--$(EXTVERSION).sql: sql/$(EXTENSION).sql   cp $< $@
endif
====

because the default target from the PostgreSQL Makefile is «all:» and the
addition of a target before inclusion of PostgreSQL makefile change the default
(see DEFAULT_GOAL variable)

Thought ?
--
Cédric Villemain +33 (0)6 20 30 22 52
http://2ndQuadrant.fr/
PostgreSQL: Support 24x7 - Développement, Expertise et Formation

pgsql-hackers by date:

Previous
From: Noah Misch
Date:
Subject: Re: Parallel Sort
Next
From: Noah Misch
Date:
Subject: Re: Parallel Sort