5 # Figure out where the git binary is.
6 .for _P in /usr/bin /usr/local/bin
7 . if !defined(GIT_CMD) || empty(GIT_CMD)
13 .if !defined(GIT_CMD) && empty(GIT_CMD)
14 . error "Git binary not found. Set GIT_CMD appropriately."
17 # Set the git branch and hash to export where needed.
18 .if !defined(GITBRANCH) || empty(GITBRANCH)
19 GITBRANCH!= ${GIT_CMD} -C ${.CURDIR} rev-parse --abbrev-ref HEAD 2>/dev/null | sed -e 's/\^\///'
22 .if !defined(GITREV) || empty(GITREV)
23 GITREV!= ${GIT_CMD} -C ${.CURDIR} rev-parse --verify --short HEAD 2>/dev/null || true
27 # Set the build date, primarily for snapshot builds.
28 .if !defined(BUILDDATE) || empty(BUILDDATE)
29 BUILDDATE!= date +%Y%m%d