summaryrefslogtreecommitdiff
path: root/mk/tools/make.mk
diff options
context:
space:
mode:
authorjlam <jlam>2005-05-02 21:10:02 +0000
committerjlam <jlam>2005-05-02 21:10:02 +0000
commit35417af2d4a66b1174f13a4c584c8857f2bc0787 (patch)
tree9fb4cd26df4c1607040ac076b155620123e3b91b /mk/tools/make.mk
parent8402fd19a6ecd058ed254ecc424ddd196322ebbc (diff)
downloadpkgsrc-35417af2d4a66b1174f13a4c584c8857f2bc0787.tar.gz
* Push the imake- and xmkmf-handling into the new tools framework.
* Get rid of an explicit check for ${_IMAKE_MAKE} == ${GMAKE} in bsd.pkg.mk to check for whether we need to depend on gmake or not. Instead, we now note in Linux.mk that packages that need imake will also need to use gmake by setting _IMAKE_TOOLS+=gmake. * Push the definition of MAKE_PROGRAM from bsd.pkg.mk into make.mk where it's closer to related code.
Diffstat (limited to 'mk/tools/make.mk')
-rw-r--r--mk/tools/make.mk27
1 files changed, 22 insertions, 5 deletions
diff --git a/mk/tools/make.mk b/mk/tools/make.mk
index b122334aa84..ff0b6990ffd 100644
--- a/mk/tools/make.mk
+++ b/mk/tools/make.mk
@@ -1,8 +1,25 @@
-# $NetBSD: make.mk,v 1.3 2005/04/26 15:32:05 jlam Exp $
-
-# Always provide a symlink from ${TOOLS_DIR}/bin/make to the "make"
-# used to build the package. This lets a bare "make" invoke the
-# correct program if called from within a makefile or script.
+# $NetBSD: make.mk,v 1.4 2005/05/02 21:10:03 jlam Exp $
+#
+# This Makefile fragment creates a tool called "make" under ${TOOLS_DIR}
+# that corresponds to the make program used to build the package.
+# This lets a bare "make" invoke the correct program if called from
+# within a makefile or script. It also sets MAKE_PROGRAM to the path
+# of that make program. Lastly, pass ${MAKE_PROGRAM} to GNU configure
+# scripts in the MAKE variable so that the scripts will embed the
+# correct correct path to the make program used to build the package
+# into the generated Makefiles.
#
+
+# Define MAKE_PROGRAM to be the "make" used to build the package.
+.if !empty(_USE_TOOLS:Mgmake)
+MAKE_PROGRAM= ${GMAKE}
+.elif !empty(_USE_TOOLS:Mimake) && defined(_IMAKE_MAKE)
+MAKE_PROGRAM= ${_IMAKE_MAKE}
+.else
+MAKE_PROGRAM= ${MAKE}
+.endif
+
TOOLS_SYMLINK+= make
TOOLS_REAL_CMD.make= ${MAKE_PROGRAM}
+
+CONFIGURE_ENV+= MAKE=${MAKE_PROGRAM:T:Q}