summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2017-08-09 12:05:53 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2017-08-09 12:05:53 -0400
commita76200de8462aa0551dde8132c11d648d0ad6e99 (patch)
tree1cbd4a01f56bc405e78c4ef1b56724295da47a12 /Makefile
parent13f03a001e4d841b6a27c0c9c3fe14e1fb2aad80 (diff)
downloadpostgresql-a76200de8462aa0551dde8132c11d648d0ad6e99.tar.gz
Prevent passing down MAKELEVEL/MAKEFLAGS from non-GNU make to GNU make.
FreeBSD's make, for one, sets the MAKELEVEL environment variable when invoking commands. In the special Makefile we provide to hand off control from a non-GNU make to GNU make, this causes GNU make to think it is a child make invocation rather than top-level. That interferes with the hack added in commit dcae5facc to cause the temp-install tree to be made only by the top-level invocation of gmake. Unset the variable to prevent that. Likewise unset MAKEFLAGS, which FreeBSD's make also sets, and which could easily confuse gmake. There are no reports of actual trouble from that, but it seems better to be proactive. Back-patch to 9.5 where dcae5facc came in. Thomas Munro, hacked a bit more by me Discussion: https://postgr.es/m/CAEepm=1ueww35AXTkt1A3gyzZUqv5XCzh8RUNvJZAQAW=eOhVw@mail.gmail.com
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile1
1 files changed, 1 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 72e9c83733..4c68950e90 100644
--- a/Makefile
+++ b/Makefile
@@ -29,6 +29,7 @@ all check install installdirs installcheck installcheck-parallel uninstall clean
\
if [ x"$${GMAKE+set}" = xset ]; then \
echo "Using GNU make found at $${GMAKE}"; \
+ unset MAKEFLAGS; unset MAKELEVEL; \
$${GMAKE} $@ ; \
else \
echo "You must use GNU make to build PostgreSQL." ; \