1 # $NetBSD: bsd.makevars.mk,v 1.4 2006/07/10 22:59:27 jlam Exp $
3 # This Makefile fragment is included by bsd.prefs.mk to set all of
4 # the variables saved through MAKEVARS. Typical usage is:
6 # .include "../../mk/bsd.prefs.mk"
8 # .if !defined(EXPENSIVE_VAR)
9 # EXPENSIVE_VAR!= ( ... an expensive computation ... )
11 # MAKEVARS+= EXPENSIVE_VAR
13 # This causes EXPENSIVE_VAR to be computed, then subsequently stored in
14 # the variable cache file. The next time through, EXPENSIVE_VAR is
15 # set by bsd.makevars.mk, which avoids running the expensive computation
18 # The cache files are created as we pass through each phase of the build,
19 # and we only include the latest cache file that was created.
22 _ALL_PHASES
= fetch tools extract patch \
23 wrapper configure build stage-install package
24 _REV_ALL_PHASES
= package stage-install build configure wrapper \
25 patch extract tools fetch
27 # Try including the *.makevars.mk files in reverse order so that the
28 # latest file is included and no more. We check for _MAKEVARS_MK since
29 # all of the *.makevars.mk files define this symbol at the top of the
32 .for _phase_ in
${_REV_ALL_PHASES}
33 _MAKEVARS_MK.
${_phase_}= ${WRKDIR}/.
${_phase_}_makevars.mk
34 . if
!target
(${_phase_}-vars
)
35 ${_phase_}-vars
: ${_MAKEVARS_MK.
${_phase_}}
37 . if
!defined
(_MAKEVARS_MK
)
38 . sinclude
"${_MAKEVARS_MK.${_phase_}}"