pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk Separate out the logic to include the correct <phas...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/c818752863b2
branches:  trunk
changeset: 494964:c818752863b2
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Wed Jun 01 03:04:16 2005 +0000

description:
Separate out the logic to include the correct <phase>.makevars.mk file
into a new file bsd.makevars.mk that can be included by other Makefiles.

diffstat:

 mk/bsd.makevars.mk |  40 ++++++++++++++++++++++++++++++++++++++++
 mk/bsd.pkg.mk      |  24 ++----------------------
 2 files changed, 42 insertions(+), 22 deletions(-)

diffs (82 lines):

diff -r 6f76d446220d -r c818752863b2 mk/bsd.makevars.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/mk/bsd.makevars.mk        Wed Jun 01 03:04:16 2005 +0000
@@ -0,0 +1,40 @@
+# $NetBSD: bsd.makevars.mk,v 1.1 2005/06/01 03:04:16 jlam Exp $
+#
+# This Makefile fragment is included by other Makefiles to set all of
+# the variables saved through MAKEVARS.  Typical usage is:
+#
+# .include "../../mk/bsd.makevars.mk"
+# .if !define(EXPENSIVE_VAR)
+# EXPENSIVE_VAR!=      ( ... an expensive computation ... )
+# .endif
+# MAKEVARS+=   EXPENSIVE_VAR
+#
+# This causes EXPENSIVE_VAR to be computed, then subsequently stored in
+# the variable cache file.  The next time through, EXPENSIVE_VAR is
+# set by bsd.makevars.mk, which avoids running the expensive computation
+# again.
+#
+# The cache files are created as we pass through each phase of the build,
+# and we only include the latest cache file that was created.
+#
+
+.if !defined(_REV_ALL_PHASES)
+_REV_ALL_PHASES=       # empty
+.  for _phase_ in ${ALL_PHASES}
+_REV_ALL_PHASES:=      ${_phase_} ${_REV_ALL_PHASES}
+.  endfor
+.endif
+MAKEVARS+=     _REV_ALL_PHASES
+
+# Try including the .makevars.mk.* files in reverse order so that the
+# latest file is included and no more.
+#
+.for _phase_ in ${_REV_ALL_PHASES}
+_MAKEVARS_MK.${_phase_}=       ${WRKDIR}/.${_phase_}_makevars.mk
+.  if !target(${_phase_}-vars)
+${_phase_}-vars: ${_MAKEVARS_MK.${_phase_}}
+.  endif
+.  if !defined(_MAKEVARS_MK)
+.    sinclude "${_MAKEVARS_MK.${_phase_}}"
+.  endif
+.endfor
diff -r 6f76d446220d -r c818752863b2 mk/bsd.pkg.mk
--- a/mk/bsd.pkg.mk     Wed Jun 01 03:02:29 2005 +0000
+++ b/mk/bsd.pkg.mk     Wed Jun 01 03:04:16 2005 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.pkg.mk,v 1.1681 2005/05/31 21:53:26 jlam Exp $
+#      $NetBSD: bsd.pkg.mk,v 1.1682 2005/06/01 03:04:16 jlam Exp $
 #
 # This file is in the public domain.
 #
@@ -20,27 +20,7 @@
 
 .include "../../mk/bsd.prefs.mk"
 .include "../../mk/bsd.hacks.mk"
-
-.if !defined(_REV_ALL_PHASES)
-_REV_ALL_PHASES=       # empty
-.  for _phase_ in ${ALL_PHASES}
-_REV_ALL_PHASES:=      ${_phase_} ${_REV_ALL_PHASES}
-.  endfor
-.  undef _phase_
-.endif
-MAKEVARS+=             _REV_ALL_PHASES
-
-# Try including the .makevars.mk.* files in reverse order so that the
-# latest file is included and no more.
-#
-.for _phase_ in ${_REV_ALL_PHASES}
-_MAKEVARS_MK.${_phase_}=       ${WRKDIR}/.${_phase_}_makevars.mk
-${_phase_}-vars: ${_MAKEVARS_MK.${_phase_}}
-.  if !defined(_MAKEVARS_MK)
-.    sinclude "${_MAKEVARS_MK.${_phase_}}"
-.  endif
-.endfor
-.undef _phase_
+.include "../../mk/bsd.makevars.mk"
 
 # This has to come first to avoid showing all BUILD_DEFS added by this
 # Makefile, which are usually not customizable.



Home | Main Index | Thread Index | Old Index