This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

"make gcc.pot" tweak


"make gcc.pot" currently dumps the .pot file in the source directory.
This is unnecessary - the primary client of that rule is/will be a
script that can move things into the source directory itself.  And, as
a matter of policy, we should be avoiding writing stuff into the
source directory.

This patch changes that.  I regret having to perpetrate another shell
mess in the middle of a rule, but VPATH won't work here - we don't
want "make update-po" always regenerating gcc.pot first.  And the rule
for gcc.pot is forced, so it would.

"make gcc.pot" and "make update-po" both work with this change.

zw

	* Makefile.in (.po.pox): Look both in srcdir and builddir
	for $(PACKAGE).pot.
	(po/$(PACKAGE).pot): Don't move-if-change the new potfile over
	to the source directory.
	* po/exgettext: Deposit new potfile in po subdir.

===================================================================
Index: Makefile.in
--- Makefile.in	2001/11/08 20:18:06	1.768
+++ Makefile.in	2001/11/08 23:20:19
@@ -3376,9 +3376,13 @@ update-po: $(CATALOGS:.gmo=.pox)
 
 # The new .po has to be gone over by hand, so we deposit it into
 # build/po with a different extension.
+# If build/po/$(PACKAGE).pot exists, use it (it was just created),
+# else use the one in srcdir.
 .po.pox:
 	test -d po || mkdir po
-	$(MSGMERGE) $< $(srcdir)/po/$(PACKAGE).pot -o $@
+	$(MSGMERGE) $< `if test -f po/$(PACKAGE).pot; \
+			then echo po/$(PACKAGE).pot; \
+			else echo $(srcdir)/po/$(PACKAGE).pot; fi` -o $@
 
 # This rule has to look for .gmo modules in both srcdir and
 # the cwd, and has to check that we actually have a catalog
@@ -3405,11 +3409,10 @@ install-po:
 # relatively harmless since the .po files do not directly depend on it.
 # Note that exgettext has an awk script embedded in it which requires a
 # fairly modern (POSIX-compliant) awk.
+# The .pot file is left in the build directory.
 $(PACKAGE).pot: po/$(PACKAGE).pot
 po/$(PACKAGE).pot: force
 	test -d po || mkdir po
 	$(MAKE) po-generated
 	AWK=$(AWK) $(SHELL) $(srcdir)/po/exgettext \
 		$(XGETTEXT) $(PACKAGE) $(srcdir)
-	$(SHELL) $(srcdir)/move-if-change $(PACKAGE).pot \
-		$(srcdir)/po/$(PACKAGE).pot
===================================================================
Index: po/exgettext
--- po/exgettext	2001/10/31 17:40:07	1.1
+++ po/exgettext	2001/11/08 23:20:19
@@ -153,4 +153,4 @@ END {
 echo "running xgettext..." >&2
 $xgettext --default-domain=$package --directory=$srcdir \
 	  --add-comments `cat $kopt` --files-from=$posr \
-	  -o $package.pot
+	  -o po/$package.pot


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]