]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
examples: hello-pascal: Fix 'make dist' failure in VPATH builds.
authorBruno Haible <bruno@clisp.org>
Wed, 17 Oct 2018 23:35:11 +0000 (01:35 +0200)
committerBruno Haible <bruno@clisp.org>
Thu, 18 Oct 2018 19:16:58 +0000 (21:16 +0200)
* gettext-tools/examples/hello-pascal/Makefile.am: Generate hello.rsj
in $(srcdir), not in the build dir.

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

index 6b9742df26284369443721dcbaa3cb14bc572245..058d64a66373337530c0d884962fe155157bdee6 100644 (file)
@@ -23,13 +23,26 @@ EXTRA_DIST = autogen.sh autoclean.sh
 
 EXTRA_DIST += $(hello_SOURCES)
 
+# Distribute the RSJ file because it's needed to generate POT files and can
+# only be rebuilt on those platforms to which the Pascal compiler is ported.
+EXTRA_DIST += hello.rsj
+# The GNU Coding Standards say in
+# <https://www.gnu.org/prep/standards/html_node/Makefile-Basics.html>:
+#   "GNU distributions usually contain some files which are not source files
+#    ... . Since these files normally appear in the source directory, they
+#    should always appear in the source directory, not in the build directory.
+#    So Makefile rules to update them should put the updated files in the
+#    source directory."
+# Therefore we put this file in the source directory, not the build directory.
+
 # Rules for compiling Pascal programs.
 
 all-local: hello$(EXEEXT)
 
 # How to build the 'hello' program.
-hello$(EXEEXT) hello.rsj: $(hello_SOURCES)
+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
 
 install-exec-local: all-local
        $(MKDIR_P) $(DESTDIR)$(bindir)
@@ -41,10 +54,6 @@ installdirs-local:
 uninstall-local:
        rm -f $(DESTDIR)$(bindir)/hello$(EXEEXT)
 
-# Distribute the RSJ file because it's needed to generate POT files and can
-# only be rebuilt on those platforms to which the Pascal compiler is ported.
-EXTRA_DIST += hello.rsj
-
 # The list of auxiliary files generated during the compilation.
 CLEANFILES = hello.o hello$(EXEEXT)