[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Makefile.in.in improvement
From: |
Jim Meyering |
Subject: |
Makefile.in.in improvement |
Date: |
Sun, 10 Mar 2002 11:34:45 +0100 |
User-agent: |
Gnus/5.090006 (Oort Gnus v0.06) Emacs/21.2.50 (i686-pc-linux-gnu) |
Hi Bruno,
Here are two changes.
The first just factors out some duplication.
The second is more important in that it prevents
a failure of msgfmt or gmsgfmt from resulting in
corrupt Makefile targets.
2002-03-10 Jim Meyering <address@hidden>
* Makefile.in.in (gmsgfmt_cmd): New variable.
(.po.gmo): Use it here.
* Makefile.in.in (.po.mo): Don't create target directly --
otherwise a failed gmsgfmt command would leave a corrupt,
yet up-to-date, .mo file.
(.po.gmo): Likewise.
Index: Makefile.in.in
===================================================================
RCS file: /cvs/gettext/gettext/po/Makefile.in.in,v
retrieving revision 1.44
diff -u -p -r1.44 Makefile.in.in
--- Makefile.in.in 2002/02/19 14:27:17 1.44
+++ Makefile.in.in 2002/03/10 10:33:29
@@ -58,13 +58,19 @@ CATALOGS = @CATALOGS@
.SUFFIXES: .po .gmo .mo .sed .sin .nop .po-update
.po.mo:
- $(MSGFMT) -c -o $@ $<
+ $(MSGFMT) -c -o t-$@ $<
+ mv t-$@ $@
+gmsgfmt_cmd = \
+ rm -f $${lang}.gmo \
+ && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po \
+ && mv t-$${lang}.gmo $${lang}.gmo
+
.po.gmo:
@lang=`echo $* | sed -e 's,.*/,,'`; \
test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
- echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o
$${lang}.gmo $${lang}.po"; \
- cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o
$${lang}.gmo $${lang}.po
+ echo "$(gmsgfmt_cmd)"; \
+ cd $(srcdir) && $(gmsgfmt_cmd)
.sin.sed:
sed -e '/^#/d' $< > t-$@
- Makefile.in.in improvement,
Jim Meyering <=