summaryrefslogtreecommitdiff
path: root/po/subdir.mk
diff options
context:
space:
mode:
Diffstat (limited to 'po/subdir.mk')
-rw-r--r--po/subdir.mk18
1 files changed, 18 insertions, 0 deletions
diff --git a/po/subdir.mk b/po/subdir.mk
new file mode 100644
index 0000000..b9a2575
--- /dev/null
+++ b/po/subdir.mk
@@ -0,0 +1,18 @@
+include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk
+include $(topsrcdir)/build-aux/Makefile.head.mk
+
+locale = $(notdir $(srcdir))
+domains = $(patsubst %.po,%,$(filter %.po,$(files.src.src)))
+
+$(outdir)/%.mo: $(srcdir)/%.po $(call at.path,$(srcdir)/../%.pot)
+ msgcmp --use-untranslated $< $(word 2,$^)
+ msgfmt -c -o $@ $<
+
+$(DESTDIR)$(localedir)/$(locale)/LC_MESSAGES/%.mo: $(outdir)/%.mo
+ install -T -Dm644 '$<' '$@'
+
+files.out.all += $(addsuffix .mo,$(domains))
+files.sys.all += $(foreach domain,$(domains),$(localedir)/$(locale)/LC_MESSAGES/$(domain).mo)
+at.subdirs += ..
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk