Makefile: avoid useless file overwrites - only write changes
authorDietmar Maurer <dietmar@proxmox.com>
Tue, 18 Oct 2016 10:37:09 +0000 (12:37 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 18 Oct 2016 10:37:09 +0000 (12:37 +0200)
Makefile

index d194591..b6881e2 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -19,7 +19,9 @@ MEDIAWIKI_DEB=${MEDIAWIKI_PACKAGE}_${DOCRELEASE}-${PKGREL}_all.deb
 all: index.html
 
 .pve-doc-depends link-refs.json: $(wildcard *.adoc) scan-adoc-refs
-       ./scan-adoc-refs *.adoc --depends .pve-doc-depends > link-refs.json
+       ./scan-adoc-refs *.adoc --depends .pve-doc-depends.tmp > link-refs.json.tmp
+       @cmp --quiet .pve-doc-depends .pve-doc-depends.tmp || mv .pve-doc-depends.tmp .pve-doc-depends
+       @cmp --quiet link-refs.json link-refs.json.tmp || mv link-refs.json.tmp link-refs.json
 
 pve-doc-generator.mk: .pve-doc-depends pve-doc-generator.mk.in
        cat pve-doc-generator.mk.in .pve-doc-depends > $@.tmp