summaryrefslogtreecommitdiffstats
path: root/include/Makefile
diff options
context:
space:
mode:
authorpst <pst@FreeBSD.org>1994-09-29 21:29:22 +0000
committerpst <pst@FreeBSD.org>1994-09-29 21:29:22 +0000
commit2bf66335a61004f895541f2c64c7fb1508224e34 (patch)
tree02af15031f4e137b44112a37bc925107c5f52c2f /include/Makefile
parentcdac251a2ea7d9193b88f19de0da43209252e9e6 (diff)
downloadFreeBSD-src-2bf66335a61004f895541f2c64c7fb1508224e34.zip
FreeBSD-src-2bf66335a61004f895541f2c64c7fb1508224e34.tar.gz
Only reinstall osreldate.h if necessary
Diffstat (limited to 'include/Makefile')
-rw-r--r--include/Makefile13
1 files changed, 8 insertions, 5 deletions
diff --git a/include/Makefile b/include/Makefile
index 816562d..176a383 100644
--- a/include/Makefile
+++ b/include/Makefile
@@ -38,6 +38,7 @@ NOOBJ= noobj
# SHARED= copies
SHARED?= symlinks
+OSREL = ${DESTDIR}/usr/include/osreldate.h
beforeinstall: ${SHARED}
@${ECHO} installing ${FILES}
@-for i in ${FILES}; do \
@@ -46,12 +47,14 @@ beforeinstall: ${SHARED}
${DESTDIR}/usr/include/$$i; \
done
@${ECHO} creating osreldate.h
- @rm -f ${DESTDIR}/usr/include/osreldate.h
- @echo \#'undef __FreeBSD_version' > ${DESTDIR}/usr/include/osreldate.h
+ @echo \#'undef __FreeBSD_version' > ${OSREL}.new
@echo \#'define __FreeBSD_version '`sysctl -n kern.osreldate` \
- >> ${DESTDIR}/usr/include/osreldate.h
- @chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/osreldate.h
- @chmod 444 ${DESTDIR}/usr/include/osreldate.h
+ >> ${OSREL}.new
+ @if cmp -s ${OSREL} ${OSREL}.new >/dev/null 2>&1 ; then \
+ rm -f ${OSREL}.new ; else \
+ mv -f ${OSREL}.new ${OSREL} ; fi
+ @chown ${BINOWN}.${BINGRP} ${OSREL}
+ @chmod 444 ${OSREL}
@${ECHO} installing ${DIRS}
@-for i in ${DIRS}; do \
if [ ! -d ${DESTDIR}/usr/include/$$i ]; \
OpenPOWER on IntegriCloud