pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk/build Changed BUILD_MAKE_FLAGS and TEST_MAKE_FLAGS ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/6a1a65ad3c22
branches:  trunk
changeset: 520721:6a1a65ad3c22
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Thu Oct 26 21:12:47 2006 +0000

description:
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:

 mk/build/build.mk |  31 ++++++++++++++++++++++++++-----
 mk/build/test.mk  |  27 ++++++++++++++++++++++-----
 2 files changed, 48 insertions(+), 10 deletions(-)

diffs (104 lines):

diff -r b2b8418aa9a4 -r 6a1a65ad3c22 mk/build/build.mk
--- a/mk/build/build.mk Thu Oct 26 20:41:56 2006 +0000
+++ b/mk/build/build.mk Thu Oct 26 21:12:47 2006 +0000
@@ -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 @@
 .  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 -r b2b8418aa9a4 -r 6a1a65ad3c22 mk/build/test.mk
--- a/mk/build/test.mk  Thu Oct 26 20:41:56 2006 +0000
+++ b/mk/build/test.mk  Thu Oct 26 21:12:47 2006 +0000
@@ -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 @@
 .    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:



Home | Main Index | Thread Index | Old Index