pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk Order the _BARRIER_POST_TARGETS so that if more tha...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/1c93693ce38b
branches:  trunk
changeset: 515680:1c93693ce38b
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Thu Jul 06 15:33:19 2006 +0000

description:
Order the _BARRIER_POST_TARGETS so that if more than one is specified on
the command-line, then we don't invoke make once for each target, and
pass them to the sub-make in a sensible order.

diffstat:

 mk/bsd.pkg.barrier.mk |  46 +++++++++++++++++++++++++++++-----------------
 1 files changed, 29 insertions(+), 17 deletions(-)

diffs (74 lines):

diff -r 405cd482ebdf -r 1c93693ce38b mk/bsd.pkg.barrier.mk
--- a/mk/bsd.pkg.barrier.mk     Thu Jul 06 15:11:00 2006 +0000
+++ b/mk/bsd.pkg.barrier.mk     Thu Jul 06 15:33:19 2006 +0000
@@ -1,20 +1,35 @@
-# $NetBSD: bsd.pkg.barrier.mk,v 1.1 2006/07/05 22:21:02 jlam Exp $
+# $NetBSD: bsd.pkg.barrier.mk,v 1.2 2006/07/06 15:33:19 jlam Exp $
 
 _BARRIER_COOKIE=       ${WRKDIR}/.barrier_cookie
 
-# _BARRIER_POST_TARGETS is a list of the targets that must be built after
+# _BARRIER_PRE_TARGETS is a list of the targets that must be built before
 #      the "barrier" target invokes a new make.
 #
 _BARRIER_PRE_TARGETS=  patch
-_BARRIER_POST_TARGETS= wrapper configure build install package
 
-# These targets have the "main" targets as sources, and so they must also
-# be barrier-aware.
+# _BARRIER_POST_TARGETS is a list of the targets that must be built after
+#      the "barrier" target invokes a new make.  This list is specially
+#      ordered so that if more than one is specified on the command-line,
+#      then pkgsrc will still do the right thing.
 #
+_BARRIER_POST_TARGETS= wrapper
+_BARRIER_POST_TARGETS+=        configure
+_BARRIER_POST_TARGETS+=        build
 _BARRIER_POST_TARGETS+=        test
-_BARRIER_POST_TARGETS+=        reinstall repackage
+_BARRIER_POST_TARGETS+=        install
+_BARRIER_POST_TARGETS+=        reinstall
+_BARRIER_POST_TARGETS+=        package
+_BARRIER_POST_TARGETS+=        repackage
+
+# XXX This target should probably be handled specially.
 _BARRIER_POST_TARGETS+=        replace
 
+.for _target_ in ${_BARRIER_POST_TARGETS}
+.  if make(${_target_})
+_BARRIER_CMDLINE_TARGETS+=     ${_target_}
+.  endif
+.endfor
+
 ######################################################################
 ### barrier (PRIVATE)
 ######################################################################
@@ -33,20 +48,17 @@
 ### Note that none of foo's real source dependencies should include
 ### targets that occur before the barrier.
 ###
+
 .PHONY: barrier
 barrier: ${_BARRIER_PRE_TARGETS} barrier-cookie
 .if !exists(${_BARRIER_COOKIE})
-.  for _target_ in ${_BARRIER_POST_TARGETS}
-.    if make(${_target_})
-.      if defined(PKG_VERBOSE)
-       @${PHASE_MSG} "Invoking \`\`"${_target_:Q}"'' after barrier for ${PKGNAME}"
-.      endif
-       ${_PKG_SILENT}${_PKG_DEBUG}cd ${.CURDIR} && ${SETENV} ${BUILD_ENV} ${MAKE} ${MAKEFLAGS} ALLOW_VULNERABLE_PACKAGES= ${_target_}
-.      if defined(PKG_VERBOSE)
-       @${PHASE_MSG} "Leaving \`\`"${_target_:Q}"'' after barrier for ${PKGNAME}"
-.      endif
-.    endif
-.  endfor
+.  if defined(PKG_VERBOSE)
+       @${PHASE_MSG} "Invoking \`\`"${_BARRIER_CMDLINE_TARGETS:Q}"'' after barrier for ${PKGNAME}"
+.  endif
+       ${_PKG_SILENT}${_PKG_DEBUG}cd ${.CURDIR} && ${SETENV} ${BUILD_ENV} ${MAKE} ${MAKEFLAGS} ALLOW_VULNERABLE_PACKAGES= ${_BARRIER_CMDLINE_TARGETS}
+.  if defined(PKG_VERBOSE)
+       @${PHASE_MSG} "Leaving \`\`"${_BARRIER_CMDLINE_TARGETS:Q}"'' after barrier for ${PKGNAME}"
+.  endif
 .endif
 
 ######################################################################



Home | Main Index | Thread Index | Old Index