aboutsummaryrefslogtreecommitdiff
path: root/src/rc
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2009-10-16 08:13:34 +0100
committerRoy Marples <roy@marples.name>2009-10-16 08:13:34 +0100
commitac6808a73ef51e78080c7eae509831b00a4d8f7b (patch)
tree7fb6193938a41d2061f99261a334cdece06070b0 /src/rc
parentbaeb59cd2e7bc68e95c8fb3f94ecb0c7d6e54589 (diff)
Regenerate version.h if necessary
Diffstat (limited to 'src/rc')
-rw-r--r--src/rc/Makefile11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/rc/Makefile b/src/rc/Makefile
index d9f8e11b..9d33192a 100644
--- a/src/rc/Makefile
+++ b/src/rc/Makefile
@@ -46,12 +46,17 @@ LDADD+= ${LIBDL} ${LIBKVM}
include ${MK}/${MKPAM}.mk
${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 \
- echo "#define BRANDING \"${BRANDING}\"" >> version.h; \
+ echo "#define BRANDING \"${BRANDING}\"" >> $@; \
fi
+version.h: version.h.tmp
+ cmp -s $@.tmp $@ && rm $@.tmp || mv $@.tmp $@
+
install: all
${INSTALL} -d ${DESTDIR}${SBINDIR}
${INSTALL} -m ${BINMODE} ${PROG} ${DESTDIR}${SBINDIR}