summaryrefslogtreecommitdiff
path: root/Makefile.in
diff options
context:
space:
mode:
authorBrendan O'Dea <bod@debian.org>2010-03-20 21:26:51 +1100
committerBrendan O'Dea <bod@debian.org>2010-03-20 21:26:51 +1100
commit1f649ca4ab37b8e2688bbf8d9cf9c33f08bf8755 (patch)
tree2e34bbd316cf0e01afeb8535c8f7b0bff426c55f /Makefile.in
parentafe2d94b943d67bc6ca999d30d18cddf5650af1f (diff)
downloadhelp2man-1f649ca4ab37b8e2688bbf8d9cf9c33f08bf8755.tar.gz
move tranlsated .h2m contents into .po files
Diffstat (limited to 'Makefile.in')
-rw-r--r--Makefile.in49
1 files changed, 29 insertions, 20 deletions
diff --git a/Makefile.in b/Makefile.in
index fee4de0..166bff8 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -55,15 +55,15 @@ install_base:
install_preload: preload
$(INSTALL_PROGRAM) $(preload).so $(DESTDIR)$(libdir)
-install_l10n: man_l10n
+install_l10n: msg_l10n man_l10n
for lang in $(LINGUAS); \
do \
- $(MKINSTALLDIRS) $(DESTDIR)$(mandir)/$$lang/man1; \
$(MKINSTALLDIRS) $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES; \
- $(INSTALL_DATA) $(srcdir)/$(target).$$lang.1 \
- $(DESTDIR)$(mandir)/$$lang/man1/$(target).1; \
- $(INSTALL_DATA) $(srcdir)/po/$$lang.gmo \
+ $(INSTALL_DATA) po/$$lang.gmo \
$(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(target).mo; \
+ $(MKINSTALLDIRS) $(DESTDIR)$(mandir)/$$lang/man1; \
+ $(INSTALL_DATA) $(target).$$lang.1 \
+ $(DESTDIR)$(mandir)/$$lang/man1/$(target).1; \
done
uninstall:
@@ -81,7 +81,7 @@ uninstall:
fi
clean:
- -rm -f $(target) $(target).h2m $(preload).so
+ -rm -f $(target) $(target).h2m $(target).*.h2m $(preload).so
-rm -rf localetmp
mostlyclean: clean
@@ -109,23 +109,32 @@ $(preload).so: $(srcdir)/$(preload).c
$(CC) $(CFLAGS) -o $@ -fPIC -shared $? $(LIBS)
man: $(target).1
-$(target).1: $(srcdir)/$(target).PL $(srcdir)/$(target).h2m.PL
- $(MAKE) $(target) $(target).h2m
+$(target).1: $(srcdir)/$(target).PL $(target).h2m
./$(target) --include=$(target).h2m --output=$@ ./$(target)
+msg_l10n: $(addprefix po/,$(addsuffix .gmo,$(LINGUAS)))
+po/%.gmo: $(srcdir)/po/%.po
+ test -d po || mkdir po
+ $(MSGFMT) -o $@ $?
+
+localetmp/%/LC_MESSAGES/$(target).mo: po/%.gmo
+ lang=$(patsubst localetmp/%/LC_MESSAGES/$(target).mo,%,$@); \
+ $(MKINSTALLDIRS) localetmp/$$lang/LC_MESSAGES && \
+ $(INSTALL_DATA) po/$$lang.gmo localetmp/$$lang/LC_MESSAGES/$(target).mo
+
man_l10n: $(addprefix $(target).,$(addsuffix .1,$(LINGUAS)))
-$(target).%.1: $(srcdir)/$(target).PL $(srcdir)/$(target).%.h2m $(srcdir)/po/%.po
+$(target).%.1: $(target) $(preload).so localetmp/%/LC_MESSAGES/$(target).mo \
+ $(target).%.h2m
lang=$(patsubst $(target).%.1,%,$@); \
- $(MAKE) $(target) $(preload).so po/$$lang.gmo && \
- $(MKINSTALLDIRS) localetmp/$$lang/LC_MESSAGES && \
- $(INSTALL_DATA) po/$$lang.gmo localetmp/$$lang/LC_MESSAGES/$(target).mo && \
LD_PRELOAD=./$(preload).so LOCALEDIR=localetmp TEXTDOMAIN=help2man \
- ./$(target) --include=$(srcdir)/$(target).$$lang.h2m \
- --output=$@ ./$(target)
+ ./$(target) --include=$(target).$$lang.h2m --output=$@ ./$(target)
-po/%.gmo: $(srcdir)/po/%.po
- test -d po || mkdir po
- $(MSGFMT) -o $@ $?
+$(target).%.h2m: $(srcdir)/$(target).h2m.PL localetmp/%/LC_MESSAGES/$(target).mo
+ lang=$(patsubst $(target).%.h2m,%,$@); \
+ locale=$$(echo $$lang $$lang | \
+ sed -n "/^$$lang"'\s/{s/^\S\+\s\+//p; q}' $(srcdir)/locales -); \
+ $(PERL) $(srcdir)/$(target).h2m.PL --locale="$$locale" \
+ --message-dir=localetmp --output=$@
info: $(target).info
$(target).info: $(srcdir)/$(target).texi
@@ -145,11 +154,11 @@ update-po: $(srcdir)/po/$(target).pot
msgmerge -U $(srcdir)/po/$$lang.po $(srcdir)/po/$(target).pot; \
done
-$(srcdir)/po/$(target).pot: $(target)
+$(srcdir)/po/$(target).pot: $(target) $(target).h2m.PL
xgettext -L Perl -k_ -kN_ \
- --msgid-bugs-address="Brendan O'Dea <bug-help2man@gnu.org>" -o $@ $?
+ --msgid-bugs-address="Brendan O'Dea <bug-help2man@gnu.org>" -o $@ $^
-.PHONY: all clean distclean preload man man_l10n info dvi install \
+.PHONY: all clean distclean preload man msg_l10n man_l10n info dvi install \
install_base install_preload install_l10n mostlyclean realclean \
uninstall