xref: /freebsd/release/Makefile.inc1 (revision 86e5b1377db87223c20aefbc5bf61c56422d6c8f)
1#
2# $FreeBSD$
3#
4
5# Figure out where the git binary is.
6.if !defined(GIT_CMD) || empty(GIT_CMD)
7. for _P in /usr/bin /usr/local/bin
8.  if exists(${_P}/git)
9GIT_CMD=   ${_P}/git
10.  endif
11. endfor
12. export GIT_CMD
13.else
14. error "Git binary not found.  Set GIT_CMD appropriately."
15.endif
16
17# Set the git branch and hash to export where needed.
18.if !defined(GITBRANCH) || empty(GITBRANCH)
19GITBRANCH!=	${GIT_CMD} rev-parse --abbrev-ref HEAD 2>/dev/null | sed -e 's/\^\///'
20.export GITBRANCH
21.endif
22.if !defined(GITREV) || empty(GITREV)
23GITREV!=	${GIT_CMD} rev-parse --verify --short HEAD 2>/dev/null || true
24.export GITREV
25.endif
26
27# Set the build date, primarily for snapshot builds.
28.if !defined(BUILDDATE) || empty(BUILDDATE)
29BUILDDATE!=		date +%Y%m%d
30.export BUILDDATE
31.endif
32