summaryrefslogtreecommitdiff
path: root/mk/build
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2006-10-26 21:12:47 +0000
committerrillig <rillig@pkgsrc.org>2006-10-26 21:12:47 +0000
commitb90067ade062d6effcc5fcd17ab23cc691f57d28 (patch)
tree5bd65f82023dd6b88da436c2abe51c0b72fdc0c8 /mk/build
parent9a06c399d7481fde9ac351a5b9050e3bc0105d92 (diff)
downloadpkgsrc-b90067ade062d6effcc5fcd17ab23cc691f57d28.tar.gz
Changed BUILD_MAKE_FLAGS and TEST_MAKE_FLAGS to be appended to the
common MAKE_FLAGS instead of overriding them, to align with the new definition of INSTALL_MAKE_FLAGS. The packages that override BUILD_MAKE_FLAGS don't have to be changed, since they prepended MAKE_FLAGS to BUILD_MAKE_FLAGS, except for less than five cases. In those cases, it may well have been unknown to the package author that MAKE_INSTALL_FLAGS had been an overriding variable instead of one whose value is just appended to something else. Some packages (postgresql, some compilers, Java environments, qcad) are using code copied from build.mk. These packages will have to be adjusted to the new variable definitions. To make this change easier, two new variables BUILD_MAKE_CMD and TEST_MAKE_CMD have been introduced that contain the complete command that makes up the call to make(1). This prevents further code duplication.
Diffstat (limited to 'mk/build')
-rw-r--r--mk/build/build.mk31
-rw-r--r--mk/build/test.mk27
2 files changed, 48 insertions, 10 deletions
diff --git a/mk/build/build.mk b/mk/build/build.mk
index c16acd23eec..bcc3225d704 100644
--- a/mk/build/build.mk
+++ b/mk/build/build.mk
@@ -1,14 +1,36 @@
-# $NetBSD: build.mk,v 1.7 2006/10/05 23:35:23 reed Exp $
+# $NetBSD: build.mk,v 1.8 2006/10/26 21:12:47 rillig Exp $
+#
+# This file defines what happens in the build phase, excluding the
+# self-test, which is defined in test.mk.
+#
+# Package-settable variables:
#
# BUILD_MAKE_FLAGS is the list of arguments that is passed to the make
-# process.
+# process, in addition to the usual MAKE_FLAGS.
#
# BUILD_TARGET is the target from ${MAKE_FILE} that should be invoked
# to build the sources.
#
-BUILD_MAKE_FLAGS?= ${MAKE_FLAGS}
+# Variables defined in this file:
+#
+# BUILD_MAKE_CMD
+# This command sets the proper environment for the build phase
+# and runs make(1) on it. It takes a list of make targets and
+# flags as argument.
+#
+# See also:
+# mk/build/test.mk
+#
+
+BUILD_MAKE_FLAGS?= # none
BUILD_TARGET?= all
+BUILD_MAKE_CMD= \
+ ${SETENV} ${MAKE_ENV} \
+ ${MAKE_PROGRAM} ${_MAKE_JOBS} \
+ ${MAKE_FLAGS} ${BUILD_MAKE_FLAGS} \
+ -f ${MAKE_FILE}
+
.if defined(MAKE_JOBS_SAFE) && !empty(MAKE_JOBS_SAFE:M[nN][oO])
_MAKE_JOBS= # nothing
.elif defined(MAKE_JOBS)
@@ -102,8 +124,7 @@ do-build:
. for _dir_ in ${BUILD_DIRS}
${_PKG_SILENT}${_PKG_DEBUG}${_ULIMIT_CMD} \
cd ${WRKSRC} && cd ${_dir_} && \
- ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} ${_MAKE_JOBS} \
- ${BUILD_MAKE_FLAGS} -f ${MAKE_FILE} ${BUILD_TARGET}
+ ${BUILD_MAKE_CMD} ${BUILD_TARGET}
. endfor
.endif
diff --git a/mk/build/test.mk b/mk/build/test.mk
index b3667d31a24..9ddce04008e 100644
--- a/mk/build/test.mk
+++ b/mk/build/test.mk
@@ -1,4 +1,6 @@
-# $NetBSD: test.mk,v 1.7 2006/09/09 02:35:13 obache Exp $
+# $NetBSD: test.mk,v 1.8 2006/10/26 21:12:47 rillig Exp $
+#
+# Package-settable variables:
#
# TEST_DIRS is the list of directories in which to perform the build
# process. If the directories are relative paths, then they
@@ -8,11 +10,27 @@
# process.
#
# TEST_MAKE_FLAGS is the list of arguments that is passed to the make
-# process.
+# process, in addition to the usual MAKE_FLAGS.
+#
+# Variables defined by this file:
+#
+# TEST_MAKE_CMD
+# This command sets the proper environment for the test phase
+# and runs make(1) on it. It takes a list of make targets and
+# flags as argument.
#
+# See also:
+# mk/build/build.mk
+#
+
TEST_DIRS?= ${BUILD_DIRS}
TEST_ENV+= ${MAKE_ENV}
-TEST_MAKE_FLAGS?= ${MAKE_FLAGS}
+TEST_MAKE_FLAGS?= # none
+
+TEST_MAKE_CMD= \
+ ${SETENV} ${MAKE_ENV} \
+ ${MAKE_PROGRAM} ${MAKE_FLAGS} ${TEST_MAKE_FLAGS} \
+ -f ${MAKE_FILE}
######################################################################
### test (PUBLIC)
@@ -100,8 +118,7 @@ do-test:
. for _dir_ in ${TEST_DIRS}
${_PKG_SILENT}${_PKG_DEBUG}${_ULIMIT_CMD} \
cd ${WRKSRC} && cd ${_dir_} && \
- ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} ${TEST_MAKE_FLAGS} \
- -f ${MAKE_FILE} ${TEST_TARGET}
+ ${TEST_MAKE_CMD} ${TEST_TARGET}
. endfor
. else
do-test: