Templated makefile - Mailing list pgsql-pkg-yum

From Craig Ringer
Subject Templated makefile
Date
Msg-id CAMsr+YEG13O=So3+j2zfrwa7nksGLFUod9Mz69dVKTVKe=XQAA@mail.gmail.com
Whole thread Raw
List 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

pgsql-pkg-yum by date:

Previous
From: Craig Ringer
Date:
Subject: Build process documentation? Also patches to make it easier to buildindividual packages
Next
From: Craig Ringer
Date:
Subject: Moving packages with no postgres dependency into /common/