pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Greg Stark <stark@mit.edu>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: YUriy Zhuravlev <u.zhuravlev@postgrespro.ru>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: WIP: About CMake v2
Date: Tue, 1 Sep 2015 19:27:59 -0300
Message-ID: <20150901222759.GQ2912@alvherre.pgsql> (raw)
In-Reply-To: <CAM-w4HMAS+NVp_t20Ma-JtDod7gHvHJKCHE5Tf+Kixv_inEK7w@mail.gmail.com>
References: <4184974.kkvGJ5GoEX@dinodell>
	<20150828153245.GD2912@alvherre.pgsql>
	<20150828153926.GG4857@alap3.anarazel.de>
	<CA+Tgmoa4YVONuV+xPFe242JUYpsRB8O31YZ8sJm4tXmRY5sndA@mail.gmail.com>
	<CAM-w4HMAS+NVp_t20Ma-JtDod7gHvHJKCHE5Tf+Kixv_inEK7w@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Greg Stark wrote:

> It is tempting and I've been wanting to evalangize this approach ever
> since read http://aegis.sourceforge.net/auug97.pdf but I've never
> actually had practical experience with it and iirc it's always this
> scenario of wanting to compile submodules multiple times that blocked
> using it.

I actually played with that a bit awhile back, after seeing that paper
referenced the fourth or fifth time (meh).  I converted a few of our
current subdir makefiles into "module.mk" files that were included
rather than recursed into; for instance optimizer/util/module.mk would
do this:

+OBJS += optimizer/util/clauses.o optimizer/util/joininfo.o optimizer/util/orclauses.o optimizer/util/pathnode.o optimizer/util/placeholder.o \
+       optimizer/util/plancat.o optimizer/util/predtest.o optimizer/util/relnode.o optimizer/util/restrictinfo.o optimizer/util/tlist.o optimizer/util/var.o

then the backend-level makefile would do this:

+include $(patsubst %,%/module.mk,$(NEWSUBDIRS))

where NEWSUBDIRS were the subdirs I had converted, so

NEWSUBDIRS = access optimizer

In turn, optimizer/module.mk would be this:

NEWSUBDIRS     = geqo path plan prep util

include $(patsubst %,optimizer/%/module.mk,$(NEWSUBDIRS))

It seemed to work fine for the small subset that I changed; then I got
lazy and never got around to writing a macro to do the subdir makefile
conversion (and of course I wasn't going to do it by hand).  Of course,
some things needs special treatment (postgres.bki, gram.c etc) which I
also never got around to even trying.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (160+ messages)  latest in thread

Message-ID: <20150901222759.GQ2912@alvherre.pgsql>
Permalink:  ../20150901222759.GQ2912@alvherre.pgsql/
Also on:    postgresql.org/message-id/20150901222759.GQ2912@alvherre.pgsql

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: alvherre@2ndquadrant.com, stark@mit.edu, robertmhaas@gmail.com, andres@anarazel.de, u.zhuravlev@postgrespro.ru
  Subject: Re: WIP: About CMake v2
  In-Reply-To: <20150901222759.GQ2912@alvherre.pgsql>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox