From: Bruno Haible Date: Thu, 18 Oct 2018 18:46:29 +0000 (+0200) Subject: examples: hello-pascal: Fix 'make distcheck'. X-Git-Tag: v0.20~331 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ab211863d2ca1c8fd4db638a7d3c2622f856cac9;p=thirdparty%2Fgettext.git examples: hello-pascal: Fix 'make distcheck'. * gettext-tools/examples/hello-pascal/Makefile.am (hello$(EXEEXT)): Move hello.rsj into $(srcdir) only if the new contents differs from the old contents. --- diff --git a/gettext-tools/examples/hello-pascal/Makefile.am b/gettext-tools/examples/hello-pascal/Makefile.am index 058d64a66..012b96f6b 100644 --- a/gettext-tools/examples/hello-pascal/Makefile.am +++ b/gettext-tools/examples/hello-pascal/Makefile.am @@ -42,7 +42,15 @@ all-local: hello$(EXEEXT) # How to build the 'hello' program. hello$(EXEEXT) $(srcdir)/hello.rsj: $(hello_SOURCES) LOCALEDIR='@localedir@' $(PPC) -o./hello$(EXEEXT) $(hello_SOURCES) - if test '$(srcdir)' != .; then mv hello.rsj $(srcdir)/hello.rsj; fi +# Move hello.rsj into $(srcdir). But don't provoke a gratuitous error in a +# VPATH build with read-only $(srcdir). + if test '$(srcdir)' != .; then \ + if test -f $(srcdir)/hello.rsj && cmp hello.rsj $(srcdir)/hello.rsj >/dev/null; then \ + rm -f hello.rsj; \ + else \ + mv -f hello.rsj $(srcdir)/hello.rsj; \ + fi; \ + fi install-exec-local: all-local $(MKDIR_P) $(DESTDIR)$(bindir)