1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-25 01:05:37 +00:00

Fix update-po and check-po when srcdir != builddir

Now, $(lang).po files are always read and written in srcdir.
Also, document how *.gmo files end up in both srcdir and builddir.
This commit is contained in:
Kalle Olavi Niemitalo 2005-12-10 17:03:41 +01:00 committed by Jonas Fonseca
parent 0281f732ab
commit f25f944123

View File

@ -12,6 +12,10 @@ MSGMERGE = msgmerge
POTFILES_ABS_LIST = potfiles.list
# Distributed elinks-*.tar.gz packages include po/*.gmo files, so that
# users can install ELinks even if they don't have a msgfmt program.
# However, if srcdir != builddir, then this Makefile ignores the *.gmo
# files in the srcdir and builds new ones in the builddir.
%.gmo: $(srcdir)/%.po
@file=`echo $* | sed 's,.*/,,'`.gmo \
&& rm -f $$file && echo -n $*": " \
@ -65,8 +69,8 @@ update-po: Makefile $(srcdir)/$(PACKAGE).pot
@cd $(srcdir)
@$(foreach lang,$(basename $(if $(strip $(PO)),$(PO),$(GMOFILES))), \
echo -n "$(lang): "; \
if $(MSGMERGE) $(lang).po $(PACKAGE).pot -o $(lang).new.po; then \
mv -f $(lang).new.po $(lang).po; \
if $(MSGMERGE) $(srcdir)/$(lang).po $(srcdir)/$(PACKAGE).pot -o $(lang).new.po; then \
mv -f $(lang).new.po $(srcdir)/$(lang).po; \
else \
echo "msgmerge failed!"; \
rm -f $(lang).new.po; \
@ -84,7 +88,7 @@ update-gmo: Makefile $(GMOFILES)
check-po:
@$(foreach lang,$(basename $(if $(strip $(PO)),$(PO),$(GMOFILES))), \
echo -n "$(lang): "; \
$(GMSGFMT) --check --check-accelerators=~ --verbose --statistics -o /dev/null $(lang).po; \
$(GMSGFMT) --check --check-accelerators=~ --verbose --statistics -o /dev/null $(srcdir)/$(lang).po; \
)
### Installation and distribution