Re: Makefile for parser - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Makefile for parser
Date
Msg-id Pine.LNX.4.21.0007021316130.351-100000@localhost.localdomain
Whole thread Raw
In response to Re: Makefile for parser  (Chris Bitmead <chris@bitmead.com>)
List pgsql-hackers
Chris Bitmead writes:

> Certainly the pgsql makefiles are broken for parallel make.

I think of "broken" for parallel make if it doesn't work at all, which
certainly needs to be fixed. "Unsupportive" of parallel make are things
like this:

DIRS := initdb initlocation ipcclean pg_ctl pg_dump pg_id \       pg_passwd pg_version psql scripts

all:       @for dir in $(DIRS); do $(MAKE) -C $$dir $@ || exit 1; done

because no matter how smart make is, the loop will still execute
sequentially.

But parallel make can co-exist with recursive make, like this:

DIRS := initdb initlocation ipcclean pg_ctl pg_dump pg_id \                              pg_passwd pg_version psql
scripts

all: $(DIRS:%=%-all-recursive)

.PHONY: $(DIRS:%=%-all-recursive)

$(DIRS:%=%-all-recursive):$(MAKE) -C $(subst -all-recursive,,$@) all


Then again, if you want faster builds, use -pipe. I'd like to make that
the default but I haven't found a reliable way to test for it. GCC doesn't
reject invalid switches in a detectable manner.

-- 
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: Peter Eisentraut
Date:
Subject: Re: Makefile for parser
Next
From: Peter Eisentraut
Date:
Subject: Re: 7.0.2 on Solaris