improved parallel make support

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Subject: improved parallel make support
Date: 2010-11-02 04:43:27
Message-ID: 1288673007.7765.12.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I have worked on some improvements on how we handle recursive make in
our makefiles. Most places uses for loops, which has some
disadvantages: parallel make doesn't work across directories, make -k
doesn't work, and make -q doesn't work. Instead, I went with the
approach that we already use in the src/backend directory, where we call
the subordinate makes as target prerequisites.

Note that because with this, parallel make really works, the rule
dependencies must be correct. This has always been the case, but now it
really shows up. A frequent issue is that this sort of thing no longer
works:

all: submake-libpgport zic

zic: $(ZICOBJS)

because this relies on the "all" target to execute its prerequisites in
order. Instead, you need to write it like this:

all: zic

zic: $(ZICOBJS) | submake-libpgport

(The bar is necessary so that zic isn't considered constantly out of
date because it depends on a phony target.)

This patch requires GNU make 3.80, because of the above "|" feature and
the $(eval) function. Version 3.80 is dated October 2002, so it should
be no problem, but I do occasionally read of make 3.79 around here;
maybe it's time to get rid of that. I did put in a check that makes the
build fail right away if a wrong version of make is used.

Attachment Content-Type Size
parallel-make.patch text/x-patch 27.0 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2010-11-02 05:15:26 Re: Tracking latest timeline in standby mode
Previous Message Vaibhav Kaushal 2010-11-02 04:40:29 Starting off with the development