pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk Whenever we invoke a recursive make, we need to ens...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/c90fd86b7122
branches:  trunk
changeset: 516790:c90fd86b7122
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Thu Jul 27 21:46:45 2006 +0000

description:
Whenever we invoke a recursive make, we need to ensure that the proper
environment ${PKGSRC_MAKE_ENV} is also passed along.  Create a
convenience variable RECURSIVE_MAKE that does exactly this and that
can be used in place of MAKE when invoking make recursively.

Use RECURSIVE_MAKE everywhere in pkgsrc/mk that we invoke make
recursively.

diffstat:

 mk/bsd.pkg.barrier.mk    |   4 ++--
 mk/bsd.pkg.clean.mk      |   4 ++--
 mk/bsd.pkg.mk            |  11 +++--------
 mk/bsd.pkg.readme.mk     |  22 +++++++++++-----------
 mk/bsd.pkg.subdir.mk     |  22 +++++++++++-----------
 mk/bsd.pkg.update.mk     |  26 ++++++++++++--------------
 mk/bsd.prefs.mk          |   8 +++++++-
 mk/bulk/bsd.bulk-pkg.mk  |  28 ++++++++++++++--------------
 mk/fetch/fetch-list.mk   |   6 +++---
 mk/flavor/pkg/depends.mk |   4 ++--
 mk/flavor/pkg/utility.mk |   6 +++---
 mk/install/install.mk    |   4 ++--
 12 files changed, 72 insertions(+), 73 deletions(-)

diffs (truncated from 540 to 300 lines):

diff -r 02bbda94d588 -r c90fd86b7122 mk/bsd.pkg.barrier.mk
--- a/mk/bsd.pkg.barrier.mk     Thu Jul 27 20:07:06 2006 +0000
+++ b/mk/bsd.pkg.barrier.mk     Thu Jul 27 21:46:45 2006 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.barrier.mk,v 1.10 2006/07/25 18:04:25 jlam Exp $
+# $NetBSD: bsd.pkg.barrier.mk,v 1.11 2006/07/27 21:46:45 jlam Exp $
 
 _COOKIE.barrier=       ${WRKDIR}/.barrier_cookie
 
@@ -57,7 +57,7 @@
 .  if defined(PKG_VERBOSE)
        @${PHASE_MSG} "Invoking \`\`"${_BARRIER_CMDLINE_TARGETS:Q}"'' after barrier for ${PKGNAME}"
 .  endif
-       ${_PKG_SILENT}${_PKG_DEBUG}cd ${.CURDIR} && ${SETENV} ${PKGSRC_MAKE_ENV} ${MAKE} ${MAKEFLAGS} _PKGSRC_BARRIER=yes ALLOW_VULNERABLE_PACKAGES= ${_BARRIER_CMDLINE_TARGETS}
+       ${_PKG_SILENT}${_PKG_DEBUG}cd ${.CURDIR} && ${RECURSIVE_MAKE} ${MAKEFLAGS} _PKGSRC_BARRIER=yes ALLOW_VULNERABLE_PACKAGES= ${_BARRIER_CMDLINE_TARGETS}
 .  if defined(PKG_VERBOSE)
        @${PHASE_MSG} "Leaving \`\`"${_BARRIER_CMDLINE_TARGETS:Q}"'' after barrier for ${PKGNAME}"
 .  endif
diff -r 02bbda94d588 -r c90fd86b7122 mk/bsd.pkg.clean.mk
--- a/mk/bsd.pkg.clean.mk       Thu Jul 27 20:07:06 2006 +0000
+++ b/mk/bsd.pkg.clean.mk       Thu Jul 27 21:46:45 2006 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.clean.mk,v 1.5 2006/07/20 15:42:04 jlam Exp $
+# $NetBSD: bsd.pkg.clean.mk,v 1.6 2006/07/27 21:46:45 jlam Exp $
 #
 # This Makefile fragment is included to bsd.pkg.mk and defines the
 # relevant variables and targets for the "clean" phase.
@@ -33,7 +33,7 @@
        ${_DEPENDS_WALK_CMD} ${PKGPATH} |                               \
        while read dir; do                                              \
                cd ${.CURDIR}/../../$$dir &&                            \
-               ${MAKE} ${MAKEFLAGS} CLEANDEPENDS=no clean;             \
+               ${RECURSIVE_MAKE} ${MAKEFLAGS} CLEANDEPENDS=no clean;   \
        done
 
 .PHONY: pre-clean
diff -r 02bbda94d588 -r c90fd86b7122 mk/bsd.pkg.mk
--- a/mk/bsd.pkg.mk     Thu Jul 27 20:07:06 2006 +0000
+++ b/mk/bsd.pkg.mk     Thu Jul 27 21:46:45 2006 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.pkg.mk,v 1.1877 2006/07/27 13:47:29 jlam Exp $
+#      $NetBSD: bsd.pkg.mk,v 1.1878 2006/07/27 21:46:45 jlam Exp $
 #
 # This file is in the public domain.
 #
@@ -25,11 +25,6 @@
 
 .MAIN: all
 
-# If MAKECONF is defined, then pass it down to all recursive make
-# processes invoked by pkgsrc.
-#
-PKGSRC_MAKE_ENV+=      ${MAKECONF:DMAKECONF=${MAKECONF:Q}}
-
 .include "../../mk/bsd.prefs.mk"
 
 .include "${PKGSRCDIR}/mk/flavor/bsd.flavor-vars.mk"
@@ -825,9 +820,9 @@
        else                                                    \
                ${SHCOMMENT} Cycle through some FTP server here ;\
                ${ECHO_MSG} "Installing from source" ;          \
-               ${MAKE} ${MAKEFLAGS} package                    \
+               ${RECURSIVE_MAKE} ${MAKEFLAGS} package          \
                        DEPENDS_TARGET=${DEPENDS_TARGET:Q} &&   \
-               ${MAKE} ${MAKEFLAGS} clean ;                    \
+               ${RECURSIVE_MAKE} ${MAKEFLAGS} clean ;          \
        fi
 
 .PHONY: bin-install
diff -r 02bbda94d588 -r c90fd86b7122 mk/bsd.pkg.readme.mk
--- a/mk/bsd.pkg.readme.mk      Thu Jul 27 20:07:06 2006 +0000
+++ b/mk/bsd.pkg.readme.mk      Thu Jul 27 21:46:45 2006 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.readme.mk,v 1.2 2006/07/15 20:08:33 rillig Exp $
+# $NetBSD: bsd.pkg.readme.mk,v 1.3 2006/07/27 21:46:45 jlam Exp $
 #
 # This Makefile fragment is included by bsd.pkg.mk and encapsulates the
 # code to produce README.html files in each package directory.
@@ -73,7 +73,7 @@
                ${ECHO} "$$pkg";                                        \
        else                                                            \
                if cd $$dir 2>/dev/null; then                           \
-                       ${MAKE} ${MAKEFLAGS} package-name PACKAGE_NAME_TYPE=${PACKAGE_NAME_TYPE}; \
+                       ${RECURSIVE_MAKE} ${MAKEFLAGS} package-name PACKAGE_NAME_TYPE=${PACKAGE_NAME_TYPE}; \
                else                                                    \
                        ${ECHO_MSG} "Warning: \"$$dir\" non-existent -- @pkgdep registration incomplete" >&2; \
                fi;                                                     \
@@ -84,10 +84,10 @@
 .PHONY: build-depends-list
 .if !target(build-depends-list)
 build-depends-list:
-       @for dir in `${MAKE} ${MAKEFLAGS} show-all-depends-dirs-excl`;  \
+       @for dir in `${RECURSIVE_MAKE} ${MAKEFLAGS} show-all-depends-dirs-excl`; \
        do                                                              \
                (cd ../../$$dir &&                                      \
-               ${MAKE} ${MAKEFLAGS} package-name)                      \
+               ${RECURSIVE_MAKE} ${MAKEFLAGS} package-name) \
        done
 .endif
 
@@ -170,11 +170,11 @@
        ${ECHO_N} "|${MAINTAINER}|${CATEGORIES}|";                      \
        case "A${BUILD_DEPENDS}B${DEPENDS}C" in \
                ABC) ;;                                                 \
-               *) cd ${.CURDIR} && ${ECHO_N} `${MAKE} ${MAKEFLAGS} build-depends-list | ${SORT} -u`;; \
+               *) cd ${.CURDIR} && ${ECHO_N} `${RECURSIVE_MAKE} ${MAKEFLAGS} build-depends-list | ${SORT} -u`;; \
        esac;                                                           \
        ${ECHO_N} "|";                                                  \
        if [ "${DEPENDS}" != "" ]; then                                 \
-               cd ${.CURDIR} && ${ECHO_N} `${MAKE} ${MAKEFLAGS} run-depends-list | ${SORT} -u`; \
+               cd ${.CURDIR} && ${ECHO_N} `${RECURSIVE_MAKE} ${MAKEFLAGS} run-depends-list | ${SORT} -u`; \
        fi;                                                             \
        ${ECHO_N} "|";                                                  \
        if [ "${ONLY_FOR_PLATFORM}" = "" ]; then                        \
@@ -203,7 +203,7 @@
 FTP_PKG_URL_DIR?=      /pub/pkgsrc/packages
 
 readme:
-       @cd ${.CURDIR} && ${MAKE} ${MAKEFLAGS} README.html PKG_URL=${FTP_PKG_URL_HOST}${FTP_PKG_URL_DIR}
+       @cd ${.CURDIR} && ${RECURSIVE_MAKE} ${MAKEFLAGS} README.html PKG_URL=${FTP_PKG_URL_HOST}${FTP_PKG_URL_DIR}
 .endif
 
 # This target is used to generate README.html files, very like "readme"
@@ -214,7 +214,7 @@
 CDROM_PKG_URL_DIR?=    /usr/pkgsrc/packages
 
 cdrom-readme:
-       @cd ${.CURDIR} && ${MAKE} ${MAKEFLAGS} README.html PKG_URL=${CDROM_PKG_URL_HOST}${CDROM_PKG_URL_DIR}
+       @cd ${.CURDIR} && ${RECURSIVE_MAKE} ${MAKEFLAGS} README.html PKG_URL=${CDROM_PKG_URL_HOST}${CDROM_PKG_URL_DIR}
 .endif
 
 README_NAME=   ${TEMPLATES}/README.pkg
@@ -251,7 +251,7 @@
 # the target used to generate the README.html file.
 .PHONY: README.html
 README.html: .PRECIOUS
-       @${SETENV} AWK=${AWK} BMAKE=${MAKE} ../../mk/scripts/mkdatabase -f $@.tmp1
+       @${RECURSIVE_MAKE} ../../mk/scripts/mkdatabase -f $@.tmp1
        @if ${TEST} -d ${PACKAGES}; then                                        \
                cd ${PACKAGES};                                         \
                case `${PWD_CMD}` in                                    \
@@ -289,7 +289,7 @@
 print-build-depends-list:
 .  if !empty(BUILD_DEPENDS) || !empty(DEPENDS)
        @${ECHO_N} 'This package requires package(s) "'
-       @${ECHO_N} `${MAKE} ${MAKEFLAGS} build-depends-list | ${SORT} -u`
+       @${ECHO_N} `${RECURSIVE_MAKE} ${MAKEFLAGS} build-depends-list | ${SORT} -u`
        @${ECHO} '" to build.'
 .  endif
 .endif
@@ -299,7 +299,7 @@
 print-run-depends-list:
 .  if !empty(DEPENDS)
        @${ECHO_N} 'This package requires package(s) "'
-       @${ECHO_N} `${MAKE} ${MAKEFLAGS} run-depends-list | ${SORT} -u`
+       @${ECHO_N} `${RECURSIVE_MAKE} ${MAKEFLAGS} run-depends-list | ${SORT} -u`
        @${ECHO} '" to run.'
 .  endif
 .endif
diff -r 02bbda94d588 -r c90fd86b7122 mk/bsd.pkg.subdir.mk
--- a/mk/bsd.pkg.subdir.mk      Thu Jul 27 20:07:06 2006 +0000
+++ b/mk/bsd.pkg.subdir.mk      Thu Jul 27 21:46:45 2006 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.pkg.subdir.mk,v 1.64 2006/05/29 14:26:33 joerg Exp $
+#      $NetBSD: bsd.pkg.subdir.mk,v 1.65 2006/07/27 21:46:45 jlam Exp $
 #      Derived from: FreeBSD Id: bsd.port.subdir.mk,v 1.19 1997/03/09 23:10:56 wosch Exp
 #      from: @(#)bsd.subdir.mk 5.9 (Berkeley) 2/1/91
 #
@@ -71,7 +71,7 @@
                if [ "$$OK" = "" ]; then \
                        cd ${.CURDIR}/$${edir}; \
                        ${ECHO_MSG} "===> ${_THISDIR_}$${edir}"; \
-                       ${MAKE} ${MAKEFLAGS} "_THISDIR_=${_THISDIR_}$${edir}/" \
+                       ${RECURSIVE_MAKE} ${MAKEFLAGS} "_THISDIR_=${_THISDIR_}$${edir}/" \
                            ${.TARGET:realinstall=install} || true; \
                fi; \
        done
@@ -82,7 +82,7 @@
        else \
                cd ${.CURDIR}/${.TARGET}; \
        fi; \
-       ${MAKE} ${MAKEFLAGS} all
+       ${RECURSIVE_MAKE} ${MAKEFLAGS} all
 
 .for __target in all fetch package extract configure build clean \
                cleandir distclean depend describe reinstall tags checksum \
@@ -116,12 +116,12 @@
 
 .if !target(readme)
 readme:
-       @${MAKE} ${MAKEFLAGS} README.html _README_TYPE_FLAG=--ftp _README_TYPE=$@
+       @${RECURSIVE_MAKE} ${MAKEFLAGS} README.html _README_TYPE_FLAG=--ftp _README_TYPE=$@
 .endif
 
 .if !target(cdrom-readme)
 cdrom-readme:
-       @${MAKE} ${MAKEFLAGS} README.html _README_TYPE_FLAG=--cdrom README_TYPE=$@
+       @${RECURSIVE_MAKE} ${MAKEFLAGS} README.html _README_TYPE_FLAG=--cdrom README_TYPE=$@
 .endif
 
 .if defined(PKGSRCTOP)
@@ -139,9 +139,9 @@
 .for entry in ${SUBDIR}
 .if defined(PKGSRCTOP)
        @${ECHO} '<TR><TD VALIGN=TOP><a href="'${entry}/README.html'">'"`${ECHO} ${entry} | ${HTMLIFY}`"'</a>: <TD>' >> $@.tmp
-       @${ECHO} `cd ${entry} && ${MAKE} ${MAKEFLAGS} show-comment | ${HTMLIFY}` >> $@.tmp
+       @${ECHO} `cd ${entry} && ${RECURSIVE_MAKE} ${MAKEFLAGS} show-comment | ${HTMLIFY}` >> $@.tmp
 .else
-       @${ECHO} '<TR><TD VALIGN=TOP><a href="'${entry}/README.html'">'"`cd ${entry}; ${MAKE} ${MAKEFLAGS} make-readme-html-help`" >> $@.tmp
+       @${ECHO} '<TR><TD VALIGN=TOP><a href="'${entry}/README.html'">'"`cd ${entry}; ${RECURSIVE_MAKE} ${MAKEFLAGS} make-readme-html-help`" >> $@.tmp
 .endif
 .endfor
        @${SORT} -t '>' +3 -4 $@.tmp > $@.tmp2
@@ -168,7 +168,7 @@
        fi
        @${RM} -f $@.tmp $@.tmp2 $@.tmp3 $@.tmp4
 .for subdir in ${SUBDIR}
-       @cd ${subdir} && ${MAKE} ${MAKEFLAGS} "_THISDIR_=${_THISDIR_}${.CURDIR:T}/" ${_README_TYPE}
+       @cd ${subdir} && ${RECURSIVE_MAKE} ${MAKEFLAGS} "_THISDIR_=${_THISDIR_}${.CURDIR:T}/" ${_README_TYPE}
 .endfor
 .endif
 
@@ -193,7 +193,7 @@
                        ${ECHO_MSG} "===> ${_THISDIR_}$${entry} non-existent"; \
                fi;                                                     \
                if [ "$$OK" = "" ]; then                                \
-                       cd ${.CURDIR}/$${edir} && ${MAKE} ${MAKEFLAGS} show-distfiles; \
+                       cd ${.CURDIR}/$${edir} && ${RECURSIVE_MAKE} ${MAKEFLAGS} show-distfiles; \
                fi;                                                     \
        done
 .endif
@@ -220,7 +220,7 @@
        @${ECHO} '#'
 .if defined(PKGSRCTOP) && !defined(SPECIFIC_PKGS)
 #      Recursing over dependencies would be pointless, in this case.
-       @${MAKE} ${MAKEFLAGS} fetch-list-one-pkg                \
+       @${RECURSIVE_MAKE} ${MAKEFLAGS} fetch-list-one-pkg      \
        | ${AWK} '                                              \
        function do_block () {                                  \
                if (FoundSomething) {                           \
@@ -238,7 +238,7 @@
        END { do_block() }                                      \
        '
 .else
-       @${MAKE} ${MAKEFLAGS} fetch-list-recursive              \
+       @${RECURSIVE_MAKE} ${MAKEFLAGS} fetch-list-recursive    \
        | ${SED} '/^=/d'
 .endif
 .endif # !target(fetch-list)
diff -r 02bbda94d588 -r c90fd86b7122 mk/bsd.pkg.update.mk
--- a/mk/bsd.pkg.update.mk      Thu Jul 27 20:07:06 2006 +0000
+++ b/mk/bsd.pkg.update.mk      Thu Jul 27 21:46:45 2006 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.update.mk,v 1.5 2006/06/07 10:04:03 tron Exp $
+# $NetBSD: bsd.pkg.update.mk,v 1.6 2006/07/27 21:46:45 jlam Exp $
 #
 # This Makefile fragment is included by bsd.pkg.mk and contains the targets
 # and variables for "make update".
@@ -42,24 +42,23 @@
        @${PHASE_MSG} "Resuming update for ${PKGNAME}"
 .  if ${REINSTALL} != "NO" && ${UPDATE_TARGET} != "replace"
        ${_PKG_SILENT}${_PKG_DEBUG}                                     \
-               ${MAKE} ${MAKEFLAGS} deinstall _UPDATE_RUNNING=YES DEINSTALLDEPENDS=ALL
+               ${RECURSIVE_MAKE} ${MAKEFLAGS} deinstall _UPDATE_RUNNING=YES DEINSTALLDEPENDS=ALL
 .  endif
 .else
 RESUMEUPDATE?= NO
 CLEAR_DIRLIST?=        YES
 
 update:
-       ${_PKG_SILENT}${_PKG_DEBUG}${MAKE} ${MAKEFLAGS} ${_DDIR}
+       ${_PKG_SILENT}${_PKG_DEBUG}${RECURSIVE_MAKE} ${MAKEFLAGS} ${_DDIR}
 .  if ${UPDATE_TARGET} != "replace"
        ${_PKG_SILENT}${_PKG_DEBUG}if ${PKG_INFO} -qe ${PKGBASE}; then  \
-               ${MAKE} ${MAKEFLAGS} deinstall _UPDATE_RUNNING=YES DEINSTALLDEPENDS=ALL \
+               ${RECURSIVE_MAKE} ${MAKEFLAGS} deinstall _UPDATE_RUNNING=YES DEINSTALLDEPENDS=ALL \
                || (${RM} ${_DDIR} && ${FALSE});                        \
        fi
 .  endif
 .endif
        ${_PKG_SILENT}${_PKG_DEBUG}                                     \
-               ${MAKE} ${MAKEFLAGS} ${UPDATE_TARGET} KEEP_WRKDIR=YES   \
-                       DEPENDS_TARGET=${DEPENDS_TARGET:Q}
+               ${RECURSIVE_MAKE} ${MAKEFLAGS} ${UPDATE_TARGET} KEEP_WRKDIR=YES DEPENDS_TARGET=${DEPENDS_TARGET:Q}
        ${_PKG_SILENT}${_PKG_DEBUG}                                     \
        [ ! -s ${_DDIR} ] || for dep in `${CAT} ${_DDIR}` ; do          \
                (if cd ../.. && cd "$${dep}" ; then                     \
@@ -67,9 +66,9 @@
                        if [ "(" "${RESUMEUPDATE}" = "NO" -o            \
                             "${REINSTALL}" != "NO" ")" -a              \
                             "${UPDATE_TARGET}" != "replace" ] ; then   \
-                               ${MAKE} ${MAKEFLAGS} deinstall _UPDATE_RUNNING=YES; \
+                               ${RECURSIVE_MAKE} ${MAKEFLAGS} deinstall _UPDATE_RUNNING=YES; \
                        fi &&                                           \
-                       ${MAKE} ${MAKEFLAGS} ${UPDATE_TARGET}           \
+                       ${RECURSIVE_MAKE} ${MAKEFLAGS} ${UPDATE_TARGET} \
                                DEPENDS_TARGET=${DEPENDS_TARGET:Q} ;    \
                else                                                    \
                        ${PHASE_MSG} "Skipping removed directory $${dep}"; \
@@ -77,29 +76,28 @@



Home | Main Index | Thread Index | Old Index