Module Name: src
Committed By: apb
Date: Sun Dec 2 12:10:43 UTC 2012
Modified Files:
src/tools: Makefile
Log Message:
TOOLDIR must be valid, unless MKTOOLS=no.
Add tests and .error directives to enforce this.
To generate a diff of this commit:
cvs rdiff -u -r1.163 -r1.164 src/tools/Makefile
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/tools/Makefile
diff -u src/tools/Makefile:1.163 src/tools/Makefile:1.164
--- src/tools/Makefile:1.163 Sun Dec 2 11:46:34 2012
+++ src/tools/Makefile Sun Dec 2 12:10:43 2012
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.163 2012/12/02 11:46:34 apb Exp $
+# $NetBSD: Makefile,v 1.164 2012/12/02 12:10:43 apb Exp $
.include <bsd.own.mk>
@@ -6,6 +6,17 @@
# plain make.
.MAIN: build_install
+# TOOLDIR must be valid, unless MKTOOLS=no
+.if ${MKTOOLS:Uyes} != "no"
+.if "${TOOLDIR}" == ""
+.error "TOOLDIR is undefined or empty"
+.elif "${TOOLDIR:tW:M/*}" == ""
+.error "TOOLDIR is not an absolute path: ${TOOLDIR}"
+#.elif !exists(TOOLDIR) # XXX .exists fails for directories
+#.error "TOOLDIR does not exist: ${TOOLDIR}"
+.endif
+.endif # MKTOOLS != no
+
.if ${TOOLCHAIN_MISSING} == "no"
.if defined(HAVE_GCC)
TOOLCHAIN_BITS= gmake .WAIT