From c49867e6f872dc824b34f4567ccc3388f261ac2d Mon Sep 17 00:00:00 2001 From: gjb Date: Tue, 1 Apr 2014 17:57:45 +0000 Subject: [PATCH] MFC r250143, r257079, r258086, r262670: r250143 (benno): Optimize SUBDIR_OVERRIDE such that SUBDIR isn't automatically defined if SUBDIR_OVERRIDE is defined. r257079: Fix build host pollution by avoiding calling 'uname -srp' to determine values for 'VERSION'. r262670 (marcel): Use ${MAKE} so that we always use the same version/implementation of make. r258086 (cperciva): Strip the -pN patch level from the VERSION string which gets encoded into CTF data. Otherwise FreeBSD Update builds think every kernel file has changed every time there's a security advisory, since the FreeBSD Update build code isn't smart enough to look inside CTF data to ignore those changes. Tested on: stable/9@r263881 Sponsored by: The FreeBSD Foundation git-svn-id: svn://svn.freebsd.org/base/stable/9@264014 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- Makefile.inc1 | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 01ef3d516..4cf1c91b8 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -62,6 +62,10 @@ TARGET_ARCH=${TARGET} # use that new version. And the new (dynamically-linked) /bin/sh # will expect to find appropriate libraries in /lib and /libexec. # +SRCDIR?= ${.CURDIR} +.if defined(SUBDIR_OVERRIDE) +SUBDIR= ${SUBDIR_OVERRIDE} +.else SUBDIR= share/info lib libexec SUBDIR+=bin .if ${MK_GAMES} != "no" @@ -100,9 +104,6 @@ SUBDIR+=etc SUBDIR+= ${_DIR} .endif .endfor - -.if defined(SUBDIR_OVERRIDE) -SUBDIR= ${SUBDIR_OVERRIDE} .endif .if defined(NOCLEAN) @@ -130,8 +131,11 @@ OSRELDATE= 0 .endif .if !defined(VERSION) -VERSION!= uname -srp -VERSION+= ${OSRELDATE} +REVISION!= ${MAKE} -C ${SRCDIR}/release -V REVISION +BRANCH!= ${MAKE} -C ${SRCDIR}/release -V BRANCH +SRCRELDATE!= awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \ + ${SRCDIR}/sys/sys/param.h +VERSION= FreeBSD ${REVISION}-${BRANCH:C/-p[0-9]+$//} ${TARGET_ARCH} ${SRCRELDATE} .endif KNOWN_ARCHES?= amd64 arm armeb/arm i386 i386/pc98 ia64 mipsel/mips mipseb/mips mips64el/mips mips64eb/mips mipsn32el/mips mipsn32eb/mips powerpc powerpc64/powerpc sparc64 -- 2.45.0