Add _NETBSD_VERSION_DEPENDS in bsd.own.mk. Targets that need

to be re-generated when the NetBSD version numberchanges,
or when any build-related variables change, may depend on
${_NETBSD_VERSION_DEPENDS}.
This commit is contained in:
apb 2012-11-04 10:59:13 +00:00
parent c82468c671
commit 9a72dfd1d1
2 changed files with 35 additions and 4 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: bsd.README,v 1.304 2012/10/02 04:53:11 jkoshy Exp $
# $NetBSD: bsd.README,v 1.305 2012/11/04 10:59:13 apb Exp $
# @(#)bsd.README 8.2 (Berkeley) 4/2/94
This is the README file for the make "include" files for the NetBSD
@ -499,6 +499,28 @@ _SRC_TOP_ Top of the system source tree, as determined by <bsd.own.mk>
is "internal" to <bsd.own.mk>, although its value is only
determined once and then propagated to all sub-makes.
_NETBSD_VERSION_DEPENDS
A list of files which contain information about
the version of the NetBSD being built. This is
defined only if the current directory appears
to be inside a NetBSD source tree. The list of
files includes ${NETBSDSRCDIR}/sys/sys/param.h
(which contains the kernel version number),
${NETBSDSRCDIR}/sys/conf/newvers.sh and
${NETBSDSRCDIR}/sys/conf/osrelease.sh (which
interpret the information in sys/sys/param.h), and
${_SRC_TOP_OBJ_}/params (which is an optional file,
created by "make build" in ${_SRC_TOP_}/Makefile,
containing all the variables that may influence the
build).
Targets that depend on the NetBSD version, or on
variables defined at build time, can declare a
dependency on ${_NETBSD_VERSION_DEPENDS}, like this:
version.c: ${_NETBSD_VERSION_DEPENDS}
commands to create version.c
BSDSRCDIR The real path to the system sources, so that 'make obj'
will work correctly. [/usr/src]

View File

@ -1,4 +1,4 @@
# $NetBSD: bsd.own.mk,v 1.706 2012/08/16 05:30:55 matt Exp $
# $NetBSD: bsd.own.mk,v 1.707 2012/11/04 10:59:13 apb Exp $
# This needs to be before bsd.init.mk
.if defined(BSD_MK_COMPAT_FILE)
@ -107,8 +107,11 @@ _SRC_TOP_!= cd "${.CURDIR}"; while :; do \
.endif # }
#
# If _SRC_TOP_ != "", we're within the NetBSD source tree, so set
# defaults for NETBSDSRCDIR and _SRC_TOP_OBJ_.
# If _SRC_TOP_ != "", we're within the NetBSD source tree.
# * Set defaults for NETBSDSRCDIR and _SRC_TOP_OBJ_.
# * Define _NETBSD_VERSION_DEPENDS. Targets that depend on the
# NetBSD version, or on variables defined at build time, can
# declare a dependency on ${_NETBSD_VERSION_DEPENDS}.
#
.if (${_SRC_TOP_} != "") # {
@ -119,6 +122,12 @@ _SRC_TOP_OBJ_!= cd "${_SRC_TOP_}" && ${PRINTOBJDIR}
.MAKEOVERRIDES+= _SRC_TOP_OBJ_
.endif
_NETBSD_VERSION_DEPENDS= ${_SRC_TOP_OBJ_}/params
_NETBSD_VERSION_DEPENDS+= ${NETBSDSRCDIR}/sys/sys/param.h
_NETBSD_VERSION_DEPENDS+= ${NETBSDSRCDIR}/sys/conf/newvers.sh
_NETBSD_VERSION_DEPENDS+= ${NETBSDSRCDIR}/sys/conf/osrelease.sh
${_SRC_TOP_OBJ_}/params: .NOTMAIN .OPTIONAL # created by top level "make build"
.endif # _SRC_TOP_ != "" # }