[Zrouter-src] ZRouter.org: push to ZRouter Makefile

zrouter-src at zrouter.org zrouter-src at zrouter.org
Sat Dec 3 13:19:27 UTC 2011


details:   http://zrouter.org/hg/zrouter//rev/67a983f45f57
changeset: 245:67a983f45f57
user:      ray at terran.dlink.ua
date:      Sat Dec 03 15:19:51 2011 +0200
description:
Fetch version variables for FreeBSD source tree and break the build if source
tree not accessible.
Add 4 new make(1) variables:
FREEBSD_TYPE (FreeBSD)
FREEBSD_REVISION (10.0)
FREEBSD_BRANCH (CURRENT)
FREEBSD_RELEASE (FreeBSD-10.0-CURRENT)

Submited by: Eric Kraußer_

diffstat:

 Makefile |  17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diffs (30 lines):

diff -r 44670f6925d6 -r 67a983f45f57 Makefile
--- a/Makefile	Fri Dec 02 23:12:37 2011 +0200
+++ b/Makefile	Sat Dec 03 15:19:51 2011 +0200
@@ -1,9 +1,26 @@
 
 .include <bsd.own.mk>
 
+#
+# Defaults
+#
 FREEBSD_SRC_TREE?=/usr/src
 OBJ_DIR?=/usr/obj
 
+#
+# Check access to FreeBSD source tree and fetch version variables
+#
+.if exists(${FREEBSD_SRC_TREE}/sys/conf/newvers.sh)
+FREEBSD_VERSION_VARS!=grep -E '(TYPE|REVISION|BRANCH)=\"' \
+	${FREEBSD_SRC_TREE}/sys/conf/newvers.sh | sed 's/\"//g'
+.for var in ${FREEBSD_VERSION_VARS}
+FREEBSD_${var}
+.endfor
+FREEBSD_RELEASE=${FREEBSD_TYPE}-${FREEBSD_REVISION}-${FREEBSD_BRANCH}
+.else
+.error "missing FreeBSD source tree: FREEBSD_SRC_TREE=${FREEBSD_SRC_TREE}"
+.endif
+
 # ZROUTER_ROOT can be set in environment
 .if !defined(ZROUTER_ROOT)
 ZROUTER_ROOT=${.CURDIR}


More information about the Zrouter-src mailing list