Source-Changes-HG archive

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

[src/trunk]: src/share/mk Ok, take 2 on redoing KERNOBJDIR logic.



details:   https://anonhg.NetBSD.org/src/rev/669bb06b0ddd
branches:  trunk
changeset: 518275:669bb06b0ddd
user:      jmc <jmc%NetBSD.org@localhost>
date:      Tue Nov 27 05:39:03 2001 +0000

description:
Ok, take 2 on redoing KERNOBJDIR logic.

Use the old setup for MAKEOBJDIRPREFIX but also add a new check for
_SRC_TOP_OBJ_ and use that if it's set. This allows a make release using
build.sh (which uses MAKEOBJDIR patterns) to function correctly on r/o
source tree's.

diffstat:

 share/mk/bsd.kernobj.mk |  45 +++++++++++++++++++++++++++++++++++++--------
 1 files changed, 37 insertions(+), 8 deletions(-)

diffs (65 lines):

diff -r 015fb6720af7 -r 669bb06b0ddd share/mk/bsd.kernobj.mk
--- a/share/mk/bsd.kernobj.mk   Tue Nov 27 05:17:31 2001 +0000
+++ b/share/mk/bsd.kernobj.mk   Tue Nov 27 05:39:03 2001 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.kernobj.mk,v 1.6 2001/11/27 05:17:31 jmc Exp $
+#      $NetBSD: bsd.kernobj.mk,v 1.7 2001/11/27 05:39:03 jmc Exp $
 
 # KERNSRCDIR   Is the location of the top of the kernel src.
 #              It defaults to ${BSDSRCDIR}/sys, but the top-level
@@ -15,19 +15,48 @@
 # KERNOBJDIR   Is the kernel build directory.  The kernel GENERIC for
 #              instance will be compiled in ${KERNOBJDIR}/GENERIC.
 #              The default value is
-#              ${MAKEOBJDIRPREFIX}${KERNSRCDIR}/${KERNARCHDIR}/compile
-#              if it exists or the target 'obj' is being made.
-#              Otherwise the default is
-#              ${KERNSRCDIR}/${KERNARCHDIR}/compile.
+#              ${KERNSRCDIR}/${KERNARCHDIR}/compile
+#
+#              If MAKEOBJDIRPREFIX or _SRC_TOP_OBJ is set than the value will
+#              be either 
+#
+#              ${MAKEOBJDIRPREFIX}${KERNSRCDIR}/${KERNARCHDIR}/compile
+#
+#              or
+#
+#              ${_SRC_TOP_OBJ_}/sys/${KERNARCHDIR}/compile
+#
+#              with MAKEOBJDIRPREFIX taking priority over _SRC_TOP_OBJ_ 
 # 
 
+.include <bsd.own.mk>
+
 KERNSRCDIR?=   ${BSDSRCDIR}/sys
 # just incase ${MACHINE} is not always correct
 KERNARCHDIR?=  arch/${MACHINE}
 
-.if make(obj) || exists(${MAKEOBJDIRPREFIX}${KERNSRCDIR}/${KERNARCHDIR}/compile)
-KERNOBJDIR?=   ${MAKEOBJDIRPREFIX}${KERNSRCDIR}/${KERNARCHDIR}/compile
+#
+# XXX It's ugly but it does what we need here. If making objects use the above
+# rules for trying to figure out a KERNOBJDIR.
+#
+# When coming back through here in rules (such as building kernels for
+# a release), check which vars we're using and which directory base has been
+# made in the previous obj stage to figure out which one to expose.
+#
+# All cases will fall through to the ${KERNSRCDIR}/${KERNARCHDIR}/compile case
+# if nothing ends up setting this.
+.if make(obj) || \
+    (defined(MAKEOBJDIRPREFIX) && exists(${MAKEOBJDIRPREFIX}${KERNSRCDIR}/${KERNARCHDIR}/compile)) || \
+    (defined(_SRC_TOP_OBJ_) && exists(${_SRC_TOP_OBJ_}/sys/${KERNARCHDIR}/compile))
+.if defined (MAKEOBJDIRPREFIX)
+KERNOBJDIR?=    ${MAKEOBJDIRPREFIX}${KERNSRCDIR}/${KERNARCHDIR}/compile
 .else
-KERNOBJDIR?=   ${KERNSRCDIR}/${KERNARCHDIR}/compile
+.if defined(_SRC_TOP_OBJ_) && ${_SRC_TOP_OBJ_} != ""
+KERNOBJDIR?=   ${_SRC_TOP_OBJ_}/sys/${KERNARCHDIR}/compile
+.endif
+.endif
 .endif
+
+KERNOBJDIR?=   ${KERNSRCDIR}/${KERNARCHDIR}/compile
+
 KERNCONFDIR?=  ${KERNSRCDIR}/${KERNARCHDIR}/conf



Home | Main Index | Thread Index | Old Index