Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZWu3d-00086E-Th for pgsql-hackers@arkaria.postgresql.org; Tue, 01 Sep 2015 22:29:38 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZWu3c-000884-Ud for pgsql-hackers@arkaria.postgresql.org; Tue, 01 Sep 2015 22:29:36 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZWu2J-0006cq-LU for pgsql-hackers@postgresql.org; Tue, 01 Sep 2015 22:28:15 +0000 Received: from smtp-auth.no-ip.com ([8.23.224.61] helo=out.smtp-auth.no-ip.com) by makus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1ZWu2B-0005Xf-Sz for pgsql-hackers@postgresql.org; Tue, 01 Sep 2015 22:28:14 +0000 X-No-IP: alvh.no-ip.org@noip-smtp X-Report-Spam-To: abuse@no-ip.com Received: from alvin.alvh.no-ip.org (unknown [186.37.51.29]) (Authenticated sender: alvh.no-ip.org@noip-smtp) by smtp-auth.no-ip.com (Postfix) with ESMTPA id EB01D401145; Tue, 1 Sep 2015 15:28:01 -0700 (PDT) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id 7370754F; Tue, 1 Sep 2015 19:27:59 -0300 (CLT) Date: Tue, 1 Sep 2015 19:27:59 -0300 From: Alvaro Herrera To: Greg Stark Cc: Robert Haas , Andres Freund , YUriy Zhuravlev , "pgsql-hackers@postgresql.org" Subject: Re: WIP: About CMake v2 Message-ID: <20150901222759.GQ2912@alvherre.pgsql> References: <4184974.kkvGJ5GoEX@dinodell> <20150828153245.GD2912@alvherre.pgsql> <20150828153926.GG4857@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org 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