Re: [HACKERS] "make check" with non-GNU make - Mailing list pgsql-hackers

From Thomas Munro
Subject Re: [HACKERS] "make check" with non-GNU make
Date
Msg-id CAEepm=0fnDoXaJnRQGk+FGGttgX7m2aqsmZfiNAT9tuTq7+sxw@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] "make check" with non-GNU make  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [HACKERS] "make check" with non-GNU make  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Wed, Aug 9, 2017 at 3:44 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Thomas Munro <thomas.munro@enterprisedb.com> writes:
>> Does anyone know why "make check" doesn't work on BSD systems if
>> tmp_install doesn't exist yet?  It's no big deal, you just have to run
>> "gmake check", but Makefile is supposed to do that for you and it
>> works fine for every other target.  No big deal, but it'd be nice to
>> unravel this mystery...
>
>> Specifically, if you run "make check" then it invokes
>> "/usr/local/bin/gmake check" for you, but it seem to skip the step
>> that builds tmp_install and so then pg_regress fails.
>
> Hmm, looking into Makefile.global.in, that step seems to be conditional on
> MAKELEVEL:
>
> temp-install:
> ifndef NO_TEMP_INSTALL
> ifneq ($(abs_top_builddir),)
> ifeq ($(MAKELEVEL),0)

Ah, right.  That coding is recommended in the GNU make manual to
distinguish from explicit invocation and recursive invocation.
FreeBSD make also seems to set MAKELEVEL.  Doing this fixes the
problem for me, though it feels a bit sneaky:

diff --git a/Makefile b/Makefile
index 72e9c83733..399e69540f 100644
--- a/Makefile
+++ b/Makefile
@@ -29,7 +29,7 @@ all check install installdirs installcheck
installcheck-parallel uninstall clean       \        if [ x"$${GMAKE+set}" = xset ]; then \          echo "Using GNU
makefound at $${GMAKE}"; \
 
-          $${GMAKE} $@ ; \
+          MAKELEVEL= $${GMAKE} $@ ; \        else \          echo "You must use GNU make to build PostgreSQL." ; \
    false; \
 

-- 
Thomas Munro
http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: 송기훈
Date:
Subject: [HACKERS] Error : undefined symbol : LWLockAssign in 9.6.3
Next
From: Andres Freund
Date:
Subject: Re: [HACKERS] Error : undefined symbol : LWLockAssign in 9.6.3