freebsd-dev/bin/freebsd-version/Makefile
Warner Losh 02e2acce1d Convert freebsd-version to using -v
newvers.sh has supported a variable setting only mode, use that in
preference to grep to future proof this script from changes there.

Differential Revision: https://reviews.freebsd.org/D19849
2019-05-23 17:19:00 +00:00

21 lines
496 B
Makefile

# $FreeBSD$
PACKAGE=runtime
SCRIPTS = freebsd-version
MAN = freebsd-version.1
CLEANFILES = freebsd-version freebsd-version.sh
NEWVERS = ${SRCTOP}/sys/conf/newvers.sh
freebsd-version.sh: ${.CURDIR}/freebsd-version.sh.in ${NEWVERS}
eval $$(sh ${NEWVERS} -v); \
if ! sed -e "\
s/@@TYPE@@/$${TYPE}/g; \
s/@@REVISION@@/$${REVISION}/g; \
s/@@BRANCH@@/$${BRANCH}/g; \
" ${.CURDIR}/freebsd-version.sh.in >${.TARGET} ; then \
rm -f ${.TARGET} ; \
exit 1 ; \
fi
.include <bsd.prog.mk>