]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
examples: Fix 'make' failures in VPATH builds.
authorBruno Haible <bruno@clisp.org>
Wed, 17 Oct 2018 12:55:58 +0000 (14:55 +0200)
committerBruno Haible <bruno@clisp.org>
Thu, 18 Oct 2018 19:16:18 +0000 (21:16 +0200)
* gettext-tools/examples/hello-java*/Makefile.am (hello_RESOURCES,
MAINTAINERCLEANFILES): Remove variables.
(hello.jar): Use two jar commands, to combine .class files from the build dir
with .properties files from the source dir.
* gettext-tools/examples/hello-java*/po/Makefile.am (update-properties,
update-classes): Reference the .pot file in the source dir, not in the build
dir.
(echo-catalogs): Include the fallback catalog.
* gettext-tools/examples/hello-pascal/Makefile.am (hello_SOURCES): Add $(srcdir)
prefix.
(hello$(EXEEXT)): Use -o option to specify where the object file and the
executable file shall be created.

gettext-tools/examples/hello-java-awt/Makefile.am
gettext-tools/examples/hello-java-awt/po/Makefile.am
gettext-tools/examples/hello-java-qtjambi/Makefile.am
gettext-tools/examples/hello-java-qtjambi/po/Makefile.am
gettext-tools/examples/hello-java-swing/Makefile.am
gettext-tools/examples/hello-java-swing/po/Makefile.am
gettext-tools/examples/hello-java/Makefile.am
gettext-tools/examples/hello-java/po/Makefile.am
gettext-tools/examples/hello-pascal/Makefile.am

index 2281fbde34a5ab3a9402228a1d682911469267a7..2b9c71d1b9a691d1be800b637783f68f4b093b4c 100644 (file)
@@ -23,13 +23,6 @@ hello_MAINCLASS = Hello
 # The link dependencies of the 'hello' program.
 hello_JAVALIBS = @LIBINTL_JAR@
 
-# The resources of the 'hello' program, excluding message catalogs, but
-# including the fallback message catalog.
-hello_RESOURCES = hello-java-awt.properties
-
-# Resources that are generated from PO files.
-MAINTAINERCLEANFILES = hello-java-awt*.properties
-
 # Additional files to be distributed.
 EXTRA_DIST = autogen.sh autoclean.sh
 
@@ -56,9 +49,9 @@ all-local: hello.jar hello.sh
 
 hello.jar: $(hello_CLASSES)
        { echo "Manifest-Version: 1.0"; echo "Main-Class: $(hello_MAINCLASS)"; echo 'Class-Path: @LIBINTL_JAR@'; } > Manifest.mf
-       catalogs=`MAKEFLAGS= $(MAKE) -s -C po echo-catalogs`; \
-       $(JAR) cfm $@ Manifest.mf Hello*.class $(hello_RESOURCES) $$catalogs
+       $(JAR) cfm $@ Manifest.mf Hello*.class
        rm -f Manifest.mf
+       abs_jar=`pwd`/$@; (cd po && $(MAKE)) && catalogs=`GNUMAKEFLAGS=--no-print-directory $(MAKE) -s -C po echo-catalogs`; test -n "$$catalogs" && (cd $(srcdir) && $(JAR) uf "$$abs_jar" $$catalogs) || { rm -f $@ jartmp*; exit 1; }
 
 Hello.class: $(srcdir)/Hello.java
        CLASSPATH=.@CLASSPATH_SEPARATOR@$(hello_JAVALIBS) $(JAVACOMP) -d . $(srcdir)/Hello.java
index b8cf04bfe8b16ad985cc49c3c2982af3df5919b9..2ac2a415f0c190c6203b733623360177f0958086 100644 (file)
@@ -245,9 +245,9 @@ update-po: Makefile
 
 $(DUMMYPOFILES):
 
-update-properties: Makefile $(DOMAIN).pot $(POFILES)
-       @echo "$(MSGINIT) -i $(DOMAIN).pot --no-translator -l en --properties-output -o $(top_srcdir)/$(DOMAIN).properties"; \
-       $(MSGINIT) -i $(DOMAIN).pot --no-translator -l en --properties-output -o $(top_srcdir)/$(DOMAIN).properties || { rm -f $(top_srcdir)/$(DOMAIN).properties; exit 1; }
+update-properties: Makefile $(srcdir)/$(DOMAIN).pot $(POFILES)
+       @echo "$(MSGINIT) -i $(srcdir)/$(DOMAIN).pot --no-translator -l en --properties-output -o $(top_srcdir)/$(DOMAIN).properties"; \
+       $(MSGINIT) -i $(srcdir)/$(DOMAIN).pot --no-translator -l en --properties-output -o $(top_srcdir)/$(DOMAIN).properties || { rm -f $(top_srcdir)/$(DOMAIN).properties; exit 1; }
        @for f in $(POFILES); do \
          lang=`echo $$f | sed -e 's,.*/,,' -e 's,\.po$$,,'`; \
          echo "$(GMSGFMT) -c --statistics --verbose -o /dev/null $(srcdir)/$${lang}.po"; \
@@ -258,9 +258,9 @@ update-properties: Makefile $(DOMAIN).pot $(POFILES)
        done
 
 # Alternatively, we could create classes instead of properties files.
-update-classes: Makefile $(DOMAIN).pot $(POFILES)
-       @echo "$(MSGINIT) -i $(DOMAIN).pot --no-translator -l en --properties-output -o $(top_srcdir)/$(DOMAIN).properties"; \
-       $(MSGINIT) -i $(DOMAIN).pot --no-translator -l en --properties-output -o $(top_srcdir)/$(DOMAIN).properties || { rm -f $(top_srcdir)/$(DOMAIN).properties; exit 1; }
+update-classes: Makefile $(srcdir)/$(DOMAIN).pot $(POFILES)
+       @echo "$(MSGINIT) -i $(srcdir)/$(DOMAIN).pot --no-translator -l en --properties-output -o $(top_srcdir)/$(DOMAIN).properties"; \
+       $(MSGINIT) -i $(srcdir)/$(DOMAIN).pot --no-translator -l en --properties-output -o $(top_srcdir)/$(DOMAIN).properties || { rm -f $(top_srcdir)/$(DOMAIN).properties; exit 1; }
        @for f in $(POFILES); do \
          lang=`echo $$f | sed -e 's,.*/,,' -e 's,\.po$$,,'`; \
          echo "$(GMSGFMT) -c --statistics --verbose -j -d $(top_srcdir) -r $(DOMAIN) -l $${lang} $(srcdir)/$${lang}.po"; \
@@ -268,4 +268,5 @@ update-classes: Makefile $(DOMAIN).pot $(POFILES)
        done
 
 echo-catalogs:
-       @echo $(CATALOGS)
+# When packaging the catalogs for installation, include the fallback catalog always.
+       @echo $(DOMAIN).properties $(CATALOGS)
index 58e07c2bff0ffa43b103f8c52f3dcd4ec02b5967..8fcc709219af8ceaf9e2d9da9e143f3484262c27 100644 (file)
@@ -23,13 +23,6 @@ hello_MAINCLASS = Hello
 # The link dependencies of the 'hello' program.
 hello_JAVALIBS = @LIBINTL_JAR@
 
-# The resources of the 'hello' program, excluding message catalogs, but
-# including the fallback message catalog.
-hello_RESOURCES = hello-java-qtjambi.properties
-
-# Resources that are generated from PO files.
-MAINTAINERCLEANFILES = hello-java-qtjambi*.properties
-
 # Additional files to be distributed.
 EXTRA_DIST = autogen.sh autoclean.sh
 
@@ -56,9 +49,9 @@ all-local: hello.jar hello.sh
 
 hello.jar: $(hello_CLASSES)
        { echo "Manifest-Version: 1.0"; echo "Main-Class: $(hello_MAINCLASS)"; echo 'Class-Path: @LIBINTL_JAR@'; } > Manifest.mf
-       catalogs=`MAKEFLAGS= $(MAKE) -s -C po echo-catalogs`; \
-       $(JAR) cfm $@ Manifest.mf Hello*.class $(hello_RESOURCES) $$catalogs
+       $(JAR) cfm $@ Manifest.mf Hello*.class
        rm -f Manifest.mf
+       abs_jar=`pwd`/$@; (cd po && $(MAKE)) && catalogs=`GNUMAKEFLAGS=--no-print-directory $(MAKE) -s -C po echo-catalogs`; test -n "$$catalogs" && (cd $(srcdir) && $(JAR) uf "$$abs_jar" $$catalogs) || { rm -f $@ jartmp*; exit 1; }
 
 Hello.class: $(srcdir)/Hello.java
        CLASSPATH=.@CLASSPATH_SEPARATOR@$(hello_JAVALIBS)@CLASSPATH_SEPARATOR@$$CLASSPATH $(JAVACOMP) -d . $(srcdir)/Hello.java
index b8cf04bfe8b16ad985cc49c3c2982af3df5919b9..2ac2a415f0c190c6203b733623360177f0958086 100644 (file)
@@ -245,9 +245,9 @@ update-po: Makefile
 
 $(DUMMYPOFILES):
 
-update-properties: Makefile $(DOMAIN).pot $(POFILES)
-       @echo "$(MSGINIT) -i $(DOMAIN).pot --no-translator -l en --properties-output -o $(top_srcdir)/$(DOMAIN).properties"; \
-       $(MSGINIT) -i $(DOMAIN).pot --no-translator -l en --properties-output -o $(top_srcdir)/$(DOMAIN).properties || { rm -f $(top_srcdir)/$(DOMAIN).properties; exit 1; }
+update-properties: Makefile $(srcdir)/$(DOMAIN).pot $(POFILES)
+       @echo "$(MSGINIT) -i $(srcdir)/$(DOMAIN).pot --no-translator -l en --properties-output -o $(top_srcdir)/$(DOMAIN).properties"; \
+       $(MSGINIT) -i $(srcdir)/$(DOMAIN).pot --no-translator -l en --properties-output -o $(top_srcdir)/$(DOMAIN).properties || { rm -f $(top_srcdir)/$(DOMAIN).properties; exit 1; }
        @for f in $(POFILES); do \
          lang=`echo $$f | sed -e 's,.*/,,' -e 's,\.po$$,,'`; \
          echo "$(GMSGFMT) -c --statistics --verbose -o /dev/null $(srcdir)/$${lang}.po"; \
@@ -258,9 +258,9 @@ update-properties: Makefile $(DOMAIN).pot $(POFILES)
        done
 
 # Alternatively, we could create classes instead of properties files.
-update-classes: Makefile $(DOMAIN).pot $(POFILES)
-       @echo "$(MSGINIT) -i $(DOMAIN).pot --no-translator -l en --properties-output -o $(top_srcdir)/$(DOMAIN).properties"; \
-       $(MSGINIT) -i $(DOMAIN).pot --no-translator -l en --properties-output -o $(top_srcdir)/$(DOMAIN).properties || { rm -f $(top_srcdir)/$(DOMAIN).properties; exit 1; }
+update-classes: Makefile $(srcdir)/$(DOMAIN).pot $(POFILES)
+       @echo "$(MSGINIT) -i $(srcdir)/$(DOMAIN).pot --no-translator -l en --properties-output -o $(top_srcdir)/$(DOMAIN).properties"; \
+       $(MSGINIT) -i $(srcdir)/$(DOMAIN).pot --no-translator -l en --properties-output -o $(top_srcdir)/$(DOMAIN).properties || { rm -f $(top_srcdir)/$(DOMAIN).properties; exit 1; }
        @for f in $(POFILES); do \
          lang=`echo $$f | sed -e 's,.*/,,' -e 's,\.po$$,,'`; \
          echo "$(GMSGFMT) -c --statistics --verbose -j -d $(top_srcdir) -r $(DOMAIN) -l $${lang} $(srcdir)/$${lang}.po"; \
@@ -268,4 +268,5 @@ update-classes: Makefile $(DOMAIN).pot $(POFILES)
        done
 
 echo-catalogs:
-       @echo $(CATALOGS)
+# When packaging the catalogs for installation, include the fallback catalog always.
+       @echo $(DOMAIN).properties $(CATALOGS)
index a0de172fab50a87b957a98e9989b8dc73b4eabea..2b9c71d1b9a691d1be800b637783f68f4b093b4c 100644 (file)
@@ -23,13 +23,6 @@ hello_MAINCLASS = Hello
 # The link dependencies of the 'hello' program.
 hello_JAVALIBS = @LIBINTL_JAR@
 
-# The resources of the 'hello' program, excluding message catalogs, but
-# including the fallback message catalog.
-hello_RESOURCES = hello-java-swing.properties
-
-# Resources that are generated from PO files.
-MAINTAINERCLEANFILES = hello-java-swing*.properties
-
 # Additional files to be distributed.
 EXTRA_DIST = autogen.sh autoclean.sh
 
@@ -56,9 +49,9 @@ all-local: hello.jar hello.sh
 
 hello.jar: $(hello_CLASSES)
        { echo "Manifest-Version: 1.0"; echo "Main-Class: $(hello_MAINCLASS)"; echo 'Class-Path: @LIBINTL_JAR@'; } > Manifest.mf
-       catalogs=`MAKEFLAGS= $(MAKE) -s -C po echo-catalogs`; \
-       $(JAR) cfm $@ Manifest.mf Hello*.class $(hello_RESOURCES) $$catalogs
+       $(JAR) cfm $@ Manifest.mf Hello*.class
        rm -f Manifest.mf
+       abs_jar=`pwd`/$@; (cd po && $(MAKE)) && catalogs=`GNUMAKEFLAGS=--no-print-directory $(MAKE) -s -C po echo-catalogs`; test -n "$$catalogs" && (cd $(srcdir) && $(JAR) uf "$$abs_jar" $$catalogs) || { rm -f $@ jartmp*; exit 1; }
 
 Hello.class: $(srcdir)/Hello.java
        CLASSPATH=.@CLASSPATH_SEPARATOR@$(hello_JAVALIBS) $(JAVACOMP) -d . $(srcdir)/Hello.java
index b8cf04bfe8b16ad985cc49c3c2982af3df5919b9..2ac2a415f0c190c6203b733623360177f0958086 100644 (file)
@@ -245,9 +245,9 @@ update-po: Makefile
 
 $(DUMMYPOFILES):
 
-update-properties: Makefile $(DOMAIN).pot $(POFILES)
-       @echo "$(MSGINIT) -i $(DOMAIN).pot --no-translator -l en --properties-output -o $(top_srcdir)/$(DOMAIN).properties"; \
-       $(MSGINIT) -i $(DOMAIN).pot --no-translator -l en --properties-output -o $(top_srcdir)/$(DOMAIN).properties || { rm -f $(top_srcdir)/$(DOMAIN).properties; exit 1; }
+update-properties: Makefile $(srcdir)/$(DOMAIN).pot $(POFILES)
+       @echo "$(MSGINIT) -i $(srcdir)/$(DOMAIN).pot --no-translator -l en --properties-output -o $(top_srcdir)/$(DOMAIN).properties"; \
+       $(MSGINIT) -i $(srcdir)/$(DOMAIN).pot --no-translator -l en --properties-output -o $(top_srcdir)/$(DOMAIN).properties || { rm -f $(top_srcdir)/$(DOMAIN).properties; exit 1; }
        @for f in $(POFILES); do \
          lang=`echo $$f | sed -e 's,.*/,,' -e 's,\.po$$,,'`; \
          echo "$(GMSGFMT) -c --statistics --verbose -o /dev/null $(srcdir)/$${lang}.po"; \
@@ -258,9 +258,9 @@ update-properties: Makefile $(DOMAIN).pot $(POFILES)
        done
 
 # Alternatively, we could create classes instead of properties files.
-update-classes: Makefile $(DOMAIN).pot $(POFILES)
-       @echo "$(MSGINIT) -i $(DOMAIN).pot --no-translator -l en --properties-output -o $(top_srcdir)/$(DOMAIN).properties"; \
-       $(MSGINIT) -i $(DOMAIN).pot --no-translator -l en --properties-output -o $(top_srcdir)/$(DOMAIN).properties || { rm -f $(top_srcdir)/$(DOMAIN).properties; exit 1; }
+update-classes: Makefile $(srcdir)/$(DOMAIN).pot $(POFILES)
+       @echo "$(MSGINIT) -i $(srcdir)/$(DOMAIN).pot --no-translator -l en --properties-output -o $(top_srcdir)/$(DOMAIN).properties"; \
+       $(MSGINIT) -i $(srcdir)/$(DOMAIN).pot --no-translator -l en --properties-output -o $(top_srcdir)/$(DOMAIN).properties || { rm -f $(top_srcdir)/$(DOMAIN).properties; exit 1; }
        @for f in $(POFILES); do \
          lang=`echo $$f | sed -e 's,.*/,,' -e 's,\.po$$,,'`; \
          echo "$(GMSGFMT) -c --statistics --verbose -j -d $(top_srcdir) -r $(DOMAIN) -l $${lang} $(srcdir)/$${lang}.po"; \
@@ -268,4 +268,5 @@ update-classes: Makefile $(DOMAIN).pot $(POFILES)
        done
 
 echo-catalogs:
-       @echo $(CATALOGS)
+# When packaging the catalogs for installation, include the fallback catalog always.
+       @echo $(DOMAIN).properties $(CATALOGS)
index 86af010d29d6d4f369d2b12712c7ea7e9e4c8633..b8505f470c7a1c8bc298b26d7884df3644e0b9ac 100644 (file)
@@ -23,13 +23,6 @@ hello_MAINCLASS = Hello
 # The link dependencies of the 'hello' program.
 hello_JAVALIBS = @LIBINTL_JAR@
 
-# The resources of the 'hello' program, excluding message catalogs, but
-# including the fallback message catalog.
-hello_RESOURCES = hello-java.properties
-
-# Resources that are generated from PO files.
-MAINTAINERCLEANFILES = hello-java*.properties
-
 # Additional files to be distributed.
 EXTRA_DIST = autogen.sh autoclean.sh
 
@@ -57,9 +50,9 @@ all-local: hello.jar hello.sh
 
 hello.jar: $(hello_CLASSES)
        { echo "Manifest-Version: 1.0"; echo "Main-Class: $(hello_MAINCLASS)"; echo 'Class-Path: @LIBINTL_JAR@'; } > Manifest.mf
-       catalogs=`MAKEFLAGS= $(MAKE) -s -C po echo-catalogs`; \
-       $(JAR) cfm $@ Manifest.mf Hello*.class $(hello_RESOURCES) $$catalogs
+       $(JAR) cfm $@ Manifest.mf Hello*.class
        rm -f Manifest.mf
+       abs_jar=`pwd`/$@; (cd po && $(MAKE)) && catalogs=`GNUMAKEFLAGS=--no-print-directory $(MAKE) -s -C po echo-catalogs`; test -n "$$catalogs" && (cd $(srcdir) && $(JAR) uf "$$abs_jar" $$catalogs) || { rm -f $@ jartmp*; exit 1; }
 
 Hello.class: $(srcdir)/Hello.java
        CLASSPATH=.@CLASSPATH_SEPARATOR@$(hello_JAVALIBS) $(JAVACOMP) -d . $(srcdir)/Hello.java
index b8cf04bfe8b16ad985cc49c3c2982af3df5919b9..2ac2a415f0c190c6203b733623360177f0958086 100644 (file)
@@ -245,9 +245,9 @@ update-po: Makefile
 
 $(DUMMYPOFILES):
 
-update-properties: Makefile $(DOMAIN).pot $(POFILES)
-       @echo "$(MSGINIT) -i $(DOMAIN).pot --no-translator -l en --properties-output -o $(top_srcdir)/$(DOMAIN).properties"; \
-       $(MSGINIT) -i $(DOMAIN).pot --no-translator -l en --properties-output -o $(top_srcdir)/$(DOMAIN).properties || { rm -f $(top_srcdir)/$(DOMAIN).properties; exit 1; }
+update-properties: Makefile $(srcdir)/$(DOMAIN).pot $(POFILES)
+       @echo "$(MSGINIT) -i $(srcdir)/$(DOMAIN).pot --no-translator -l en --properties-output -o $(top_srcdir)/$(DOMAIN).properties"; \
+       $(MSGINIT) -i $(srcdir)/$(DOMAIN).pot --no-translator -l en --properties-output -o $(top_srcdir)/$(DOMAIN).properties || { rm -f $(top_srcdir)/$(DOMAIN).properties; exit 1; }
        @for f in $(POFILES); do \
          lang=`echo $$f | sed -e 's,.*/,,' -e 's,\.po$$,,'`; \
          echo "$(GMSGFMT) -c --statistics --verbose -o /dev/null $(srcdir)/$${lang}.po"; \
@@ -258,9 +258,9 @@ update-properties: Makefile $(DOMAIN).pot $(POFILES)
        done
 
 # Alternatively, we could create classes instead of properties files.
-update-classes: Makefile $(DOMAIN).pot $(POFILES)
-       @echo "$(MSGINIT) -i $(DOMAIN).pot --no-translator -l en --properties-output -o $(top_srcdir)/$(DOMAIN).properties"; \
-       $(MSGINIT) -i $(DOMAIN).pot --no-translator -l en --properties-output -o $(top_srcdir)/$(DOMAIN).properties || { rm -f $(top_srcdir)/$(DOMAIN).properties; exit 1; }
+update-classes: Makefile $(srcdir)/$(DOMAIN).pot $(POFILES)
+       @echo "$(MSGINIT) -i $(srcdir)/$(DOMAIN).pot --no-translator -l en --properties-output -o $(top_srcdir)/$(DOMAIN).properties"; \
+       $(MSGINIT) -i $(srcdir)/$(DOMAIN).pot --no-translator -l en --properties-output -o $(top_srcdir)/$(DOMAIN).properties || { rm -f $(top_srcdir)/$(DOMAIN).properties; exit 1; }
        @for f in $(POFILES); do \
          lang=`echo $$f | sed -e 's,.*/,,' -e 's,\.po$$,,'`; \
          echo "$(GMSGFMT) -c --statistics --verbose -j -d $(top_srcdir) -r $(DOMAIN) -l $${lang} $(srcdir)/$${lang}.po"; \
@@ -268,4 +268,5 @@ update-classes: Makefile $(DOMAIN).pot $(POFILES)
        done
 
 echo-catalogs:
-       @echo $(CATALOGS)
+# When packaging the catalogs for installation, include the fallback catalog always.
+       @echo $(DOMAIN).properties $(CATALOGS)
index f987b69532fb7d2789b501406f13088173e2796d..851d495e2391476f27d030b90b3e2412604374de 100644 (file)
@@ -14,7 +14,7 @@ SUBDIRS = m4 . po
 bin_PASCALPROGRAMS = hello
 
 # The source files of the 'hello' program.
-hello_SOURCES = hello.pas
+hello_SOURCES = $(srcdir)/hello.pas
 
 # Additional files to be distributed.
 EXTRA_DIST = autogen.sh autoclean.sh
@@ -25,7 +25,7 @@ all-local: hello$(EXEEXT)
 
 # How to build the 'hello' program.
 hello$(EXEEXT) hello.rsj: $(hello_SOURCES)
-       LOCALEDIR='@localedir@' $(PPC) $(hello_SOURCES)
+       LOCALEDIR='@localedir@' $(PPC) -o./hello$(EXEEXT) $(hello_SOURCES)
 
 install-exec-local: all-local
        $(MKDIR_P) $(DESTDIR)$(bindir)