On 8/6/20 10:14 am, Hans Ulrich Niedermann wrote:
install-paths.stamp: echo '/* Autogenerated file. Do not modify. */' > install-paths.h.tmp echo '#define BINDIR "$(bindir)"' >> install-paths.h.tmp @if test -f install-paths.h \ && $(CMP) install-paths.h.tmp install-paths.h; then \ echo "Not updating install-paths.h: it is up to date"; \ rm -f install-paths.h.tmp; \ else \ echo "Updating install-paths.h"; \ mv -f install-paths.h.tmp install-paths.h; \ fi
Yes, that has its obvious advantages compared with my simple rule For people having many such rules, gnulib provides a shell script, move-if-change, with that if-else logic
http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob;f=build-aux/move-if-change;h=653dc9815999073ceec2caba1b78ec8942e7973c;hb=HEAD Peter