Source-Changes-HG archive

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

[src/trunk]: src/share/mk Implement NETBSDSRCDIR, which is the top level of t...



details:   https://anonhg.NetBSD.org/src/rev/579f32169859
branches:  trunk
changeset: 526156:579f32169859
user:      lukem <lukem%NetBSD.org@localhost>
date:      Fri Apr 26 15:02:02 2002 +0000

description:
Implement NETBSDSRCDIR, which is the top level of the NetBSD source tree.
Defaults to the directory determined by the _SRC_TOP_ logic (if != ""),
and the BSDSRCDIR.

NETBSDSRCDIR has been provided for use by the various NetBSD source
Makefiles to find the top of the NetBSD source tree, and isn't
affected by the inheritance properties of _SRC_TOP_, nor does it
have the magic BSDOBJDIR baggage that BSDSRCDIR is stuck with.

diffstat:

 share/mk/bsd.README     |  12 ++++++++++--
 share/mk/bsd.kernobj.mk |   6 +++---
 share/mk/bsd.lib.mk     |   6 +++---
 share/mk/bsd.own.mk     |  16 ++++++----------
 4 files changed, 22 insertions(+), 18 deletions(-)

diffs (119 lines):

diff -r c113a49ff5cb -r 579f32169859 share/mk/bsd.README
--- a/share/mk/bsd.README       Fri Apr 26 14:56:16 2002 +0000
+++ b/share/mk/bsd.README       Fri Apr 26 15:02:02 2002 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.README,v 1.97 2002/04/19 03:08:05 itojun Exp $
+#      $NetBSD: bsd.README,v 1.98 2002/04/26 15:02:02 lukem Exp $
 #      @(#)bsd.README  8.2 (Berkeley) 4/2/94
 
 This is the README file for the new make "include" files for the BSD
@@ -202,8 +202,16 @@
 bsd.own.mk sets the following variables, if they are not already defined
 (defaults are in brackets):
 
+NETBSDSRCDIR   Top of the NetBSD source tree.
+               If _SRC_TOP_ != "", that will be used as the default,
+               otherwise BSDSRCDIR will be used as the default.
+               Various makefiles within the NetBSD source tree will
+               use this to reference the top level of the source tree.
+
 _SRC_TOP_      Top of the system source tree, as determined by <bsd.own.mk>
-               based on the presence of build.sh and tools/ .
+               based on the presence of tools/ and build.sh.  This variable
+               is "internal" to <bsd.own.mk>, although its value is only
+               determined once and then propagated to all sub-makes.
 
 BSDSRCDIR      The real path to the system sources, so that 'make obj'
                will work correctly. [/usr/src]
diff -r c113a49ff5cb -r 579f32169859 share/mk/bsd.kernobj.mk
--- a/share/mk/bsd.kernobj.mk   Fri Apr 26 14:56:16 2002 +0000
+++ b/share/mk/bsd.kernobj.mk   Fri Apr 26 15:02:02 2002 +0000
@@ -1,7 +1,7 @@
-#      $NetBSD: bsd.kernobj.mk,v 1.8 2002/04/10 15:05:45 lukem Exp $
+#      $NetBSD: bsd.kernobj.mk,v 1.9 2002/04/26 15:02:02 lukem Exp $
 
 # KERNSRCDIR   Is the location of the top of the kernel src.
-#              It defaults to ${_SRC_TOP_}/sys
+#              It defaults to ${NETBSDSRCDIR}/sys
 # 
 # KERNARCHDIR  Is the location of the machine dependent kernel
 #              sources.  It defaults to arch/${MACHINE}
@@ -28,7 +28,7 @@
 
 .include <bsd.own.mk>
 
-KERNSRCDIR?=   ${_SRC_TOP_}/sys
+KERNSRCDIR?=   ${NETBSDSRCDIR}/sys
 # just incase ${MACHINE} is not always correct
 KERNARCHDIR?=  arch/${MACHINE}
 
diff -r c113a49ff5cb -r 579f32169859 share/mk/bsd.lib.mk
--- a/share/mk/bsd.lib.mk       Fri Apr 26 14:56:16 2002 +0000
+++ b/share/mk/bsd.lib.mk       Fri Apr 26 15:02:02 2002 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.lib.mk,v 1.200 2002/04/10 15:05:45 lukem Exp $
+#      $NetBSD: bsd.lib.mk,v 1.201 2002/04/26 15:02:02 lukem Exp $
 #      @(#)bsd.lib.mk  8.3 (Berkeley) 4/22/94
 
 .include <bsd.init.mk>
@@ -19,10 +19,10 @@
 
 # Check for higher installed library versions.
 .if !defined(NOCHECKVER) && !defined(NOCHECKVER_${LIB}) && \
-       exists(${_SRC_TOP_}/lib/checkver)
+       exists(${NETBSDSRCDIR}/lib/checkver)
 checkver:
        @(cd ${.CURDIR} && \
-               sh ${_SRC_TOP_}/lib/checkver -v ${SHLIB_VERSION_FILE} \
+               sh ${NETBSDSRCDIR}/lib/checkver -v ${SHLIB_VERSION_FILE} \
                    -d ${DESTDIR}${_LIBSODIR} ${LIB})
 .endif
 .endif
diff -r c113a49ff5cb -r 579f32169859 share/mk/bsd.own.mk
--- a/share/mk/bsd.own.mk       Fri Apr 26 14:56:16 2002 +0000
+++ b/share/mk/bsd.own.mk       Fri Apr 26 15:02:02 2002 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.own.mk,v 1.287 2002/04/26 14:27:23 lukem Exp $
+#      $NetBSD: bsd.own.mk,v 1.288 2002/04/26 15:02:02 lukem Exp $
 
 .if !defined(_BSD_OWN_MK_)
 _BSD_OWN_MK_=1
@@ -45,18 +45,13 @@
 
 .endif                                 # }
 
+
 # If _SRC_TOP != "", we're within the NetBSD source tree, so set
-# various defaults.
+# defaults for NETBSDSRCDIR and _SRC_TOP_OBJ_.
 #
 .if (${_SRC_TOP_} != "")               # {
 
-#   The default for BSDSRCDIR is ${_SRC_TOP_},
-#   and the default for BSDOBJDIR is the objdir of ${BSDSRCDIR}
-#
-BSDSRCDIR?=    ${_SRC_TOP_}
-.if !defined(BSDOBJDIR)
-BSDOBJDIR!=    cd ${BSDSRCDIR} && ${PRINTOBJDIR}
-.endif
+NETBSDSRCDIR?= ${_SRC_TOP_}
 
 .if !defined(_SRC_TOP_OBJ_)
 _SRC_TOP_OBJ_!=                cd ${_SRC_TOP_} && ${PRINTOBJDIR}
@@ -95,7 +90,7 @@
 
 # Provide a default for TOOLDIR.
 .if !defined(TOOLDIR)
-_TOOLOBJ!=     cd ${_SRC_TOP_}/tools && ${PRINTOBJDIR}
+_TOOLOBJ!=     cd ${NETBSDSRCDIR}/tools && ${PRINTOBJDIR}
 TOOLDIR:=      ${_TOOLOBJ}/tools.${HOST_OSTYPE}
 .MAKEOVERRIDES+= TOOLDIR
 .endif
@@ -203,6 +198,7 @@
 #
 BSDSRCDIR?=    /usr/src
 BSDOBJDIR?=    /usr/obj
+NETBSDSRCDIR?= ${BSDSRCDIR}
 
 BINGRP?=       wheel
 BINOWN?=       root



Home | Main Index | Thread Index | Old Index