Reset MAKELEVEL=0 to fix bad gmake/bsdmake interactions.

Our make(1) now sets $MAKELEVEL. While this should cause no harm, gmake
detects a non-zero $MAKELEVEL and automatically sets "w" in $MAKEFLAGS
for subordinate makes, in order to print the entry and exit directories.
Our make, does not understand -w, so it prints an error message and exits.

In order to catch this everywhere (since cmake for example can invoke
either our make or gmake depending on how it feels), we reset the variable
for any top level command. This effectively reverts to the behavior of
our make not setting $MAKELEVEL.
This commit is contained in:
christos 2013-07-15 20:22:15 +00:00
parent 48b4ffe4ea
commit 0399286bdf

View file

@ -1,4 +1,4 @@
# $NetBSD: bsd.pkg.mk,v 1.1992 2013/06/05 08:19:57 tron Exp $
# $NetBSD: bsd.pkg.mk,v 1.1993 2013/07/15 20:22:15 christos Exp $
#
# This file is in the public domain.
#
@ -180,6 +180,7 @@ ALL_ENV+= LDFLAGS=${LDFLAGS:M*:Q}
ALL_ENV+= LINKER_RPATH_FLAG=${LINKER_RPATH_FLAG:Q}
ALL_ENV+= PATH=${PATH:Q}:${LOCALBASE}/bin:${X11BASE}/bin
ALL_ENV+= PREFIX=${PREFIX}
ALL_ENV+= MAKELEVEL=0
# This variable can be added to MAKE_ENV to ease installation of packages
# that use BSD-style Makefiles.