Module Name: src Committed By: apb Date: Sun Nov 4 10:59:13 UTC 2012
Modified Files: src/share/mk: bsd.README bsd.own.mk Log Message: 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}. To generate a diff of this commit: cvs rdiff -u -r1.304 -r1.305 src/share/mk/bsd.README cvs rdiff -u -r1.706 -r1.707 src/share/mk/bsd.own.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/share/mk/bsd.README diff -u src/share/mk/bsd.README:1.304 src/share/mk/bsd.README:1.305 --- src/share/mk/bsd.README:1.304 Tue Oct 2 04:53:11 2012 +++ src/share/mk/bsd.README Sun Nov 4 10:59:13 2012 @@ -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, 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] Index: src/share/mk/bsd.own.mk diff -u src/share/mk/bsd.own.mk:1.706 src/share/mk/bsd.own.mk:1.707 --- src/share/mk/bsd.own.mk:1.706 Thu Aug 16 05:30:55 2012 +++ src/share/mk/bsd.own.mk Sun Nov 4 10:59:13 2012 @@ -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_}" && ${ .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_ != "" # }