Templated makefile

From: Craig Ringer <craig(at)2ndquadrant(dot)com>
To: pgsql-pkg-yum <pgsql-pkg-yum(at)postgresql(dot)org>
Subject: Templated makefile
Date: 2019-12-18 08:56:09
Message-ID: CAMsr+YEG13O=So3+j2zfrwa7nksGLFUod9Mz69dVKTVKe=XQAA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-pkg-yum

Hi folks

I've attached a proposed rewrite of the Makefile.global so that it
generates all the targets for all combinations of major Pg versions,
'nosign' and 'noprep' options, 'testing' options etc. All the makefiles it
includes can be deleted along with all the mostly-but-not-quite-the-same
targets they define.

DIST is auto-detected from the Makefile path now, and the default target pg
version is too. So if you:

pushd /pgrpms/rpm/redhat/9.6/postgis25/EL-6
make
popd

it'll behave sensibly even though the Makefile in that directory can now be
nothing but a symlink to Makefile.global since it autodetects ARCH and
SPEC_FILE too. Or with a touch more work the Makefile in each subdir can be
removed entirely and the path detected from the CWD or given to the global
Makefile as an argument.

The Makefile can now invoke yum builddep or dnf build-dep for you if asked
with make INSTALL_DEPENDS=1 .

Invocation of "git pull" can be suppressed with make USE_GIT_PULL=0 for use
in containers etc.

I kept the 'nosign' and 'noprep' stuff. I'd much prefer to remove it and
turn it into make arguments like

make SIGN=0 PREP=0 build12

but I didn't want to do so without discussion here.

I attached the new Makefile.global and separately a patch that applies it
and removes the old ones. If you like what you see I can follow up with a
patch that removes the now-obsolete contents of the Makefiles across most
of the tree, so most don't have to set DIST or ARCH or SPEC_FILE explicitly
anymore.

--
Craig Ringer http://www.2ndQuadrant.com/
2ndQuadrant - PostgreSQL Solutions for the Enterprise

Attachment Content-Type Size
v1-0001-Rewrite-the-yum-repo-makefile.patch text/x-patch 75.0 KB
Makefile.global application/octet-stream 10.3 KB

Browse pgsql-pkg-yum by date

  From Date Subject
Next Message Craig Ringer 2019-12-18 09:14:25 Moving packages with no postgres dependency into /common/
Previous Message Craig Ringer 2019-12-18 06:39:57 Build process documentation? Also patches to make it easier to build individual packages