]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
examples: hello-pascal: Fix 'make distcheck'.
authorBruno Haible <bruno@clisp.org>
Thu, 18 Oct 2018 18:46:29 +0000 (20:46 +0200)
committerBruno Haible <bruno@clisp.org>
Thu, 18 Oct 2018 23:23:33 +0000 (01:23 +0200)
* gettext-tools/examples/hello-pascal/Makefile.am (hello$(EXEEXT)): Move
hello.rsj into $(srcdir) only if the new contents differs from the old contents.

gettext-tools/examples/hello-pascal/Makefile.am

index 058d64a66373337530c0d884962fe155157bdee6..012b96f6b47ebea44e4104bb8eafbf1c1d6603fd 100644 (file)
@@ -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)