freebsd-src/release/Makefile.inc1
Glen Barber 86e5b1377d release: update to use git instead of svn:
Makefile.* (cloudware):
 - Consistify setting the BUILDDATE for snapshots.

release.conf.sample/release.sh:
 - Run 'git clone' in 'quiet' mode.

Makefile.inc1:
 - Set BUILDDATE and export the variable.

Sponsored by:	Rubicon Communications, LLC (netgate.com)
2020-08-12 16:25:25 +00:00

32 lines
772 B
Makefile

#
# $FreeBSD$
#
# Figure out where the git binary is.
.if !defined(GIT_CMD) || empty(GIT_CMD)
. for _P in /usr/bin /usr/local/bin
. if exists(${_P}/git)
GIT_CMD= ${_P}/git
. endif
. endfor
. export GIT_CMD
.else
. error "Git binary not found. Set GIT_CMD appropriately."
.endif
# Set the git branch and hash to export where needed.
.if !defined(GITBRANCH) || empty(GITBRANCH)
GITBRANCH!= ${GIT_CMD} rev-parse --abbrev-ref HEAD 2>/dev/null | sed -e 's/\^\///'
.export GITBRANCH
.endif
.if !defined(GITREV) || empty(GITREV)
GITREV!= ${GIT_CMD} rev-parse --verify --short HEAD 2>/dev/null || true
.export GITREV
.endif
# Set the build date, primarily for snapshot builds.
.if !defined(BUILDDATE) || empty(BUILDDATE)
BUILDDATE!= date +%Y%m%d
.export BUILDDATE
.endif