Regenerate version.h if necessary

This commit is contained in:
Roy Marples 2009-10-16 08:13:34 +01:00
parent baeb59cd2e
commit ac6808a73e

View File

@ -46,12 +46,17 @@ LDADD+= ${LIBDL} ${LIBKVM}
include ${MK}/${MKPAM}.mk include ${MK}/${MKPAM}.mk
${SRCS}: version.h ${SRCS}: version.h
version.h:
echo "#define VERSION \"${VERSION}${GITVER}\"" >version.h .PHONY: version.h.tmp
version.h.tmp:
echo "#define VERSION \"${VERSION}${GITVER}\"" >$@
if test -n "${BRANDING}"; then \ if test -n "${BRANDING}"; then \
echo "#define BRANDING \"${BRANDING}\"" >> version.h; \ echo "#define BRANDING \"${BRANDING}\"" >> $@; \
fi fi
version.h: version.h.tmp
cmp -s $@.tmp $@ && rm $@.tmp || mv $@.tmp $@
install: all install: all
${INSTALL} -d ${DESTDIR}${SBINDIR} ${INSTALL} -d ${DESTDIR}${SBINDIR}
${INSTALL} -m ${BINMODE} ${PROG} ${DESTDIR}${SBINDIR} ${INSTALL} -m ${BINMODE} ${PROG} ${DESTDIR}${SBINDIR}