aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-04-07 22:12:29 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2022-04-07 22:12:29 +0200
commite377df7b305514d721510fe1f15921647ebc7552 (patch)
tree35dd17aaf5e29c44c0f13401b6cb86e4d7df5acd /Makefile
parentRename filename-extension{ => ?}. (diff)
parentFix translation for (vcomponent datetime output). (diff)
downloadcalp-e377df7b305514d721510fe1f15921647ebc7552.tar.gz
calp-e377df7b305514d721510fe1f15921647ebc7552.tar.xz
Merge branch 'translation'
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile18
1 files changed, 17 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index b7cea836..22ea4c08 100644
--- a/Makefile
+++ b/Makefile
@@ -20,9 +20,15 @@ GUILE_C_FLAGS = -Lmodule \
-Wmacro-use-before-definition -Warity-mismatch \
-Wduplicate-case-datum -Wbad-case-datum
-all: go_files README static
+# All po-files inside po/, except new.po, and hidden files
+PO_FILES = $(shell find po -type f -name \*.po -and -not -name new.po -and -not -name .\*)
+LOCALIZATIONS = $(PO_FILES:po/%.po=localization/%/LC_MESSAGES/calp.mo)
+
+all: go_files README static $(LOCALIZATIONS)
$(MAKE) -C doc/ref
+XGETTEXT_FLAGS = --from-code=UTF-8 --add-comments --indent -k_
+
static:
$(MAKE) -C static
@@ -34,6 +40,16 @@ obj-$(GUILE_VERSION)/%.go: module/%.scm
# automatically compile everything before they run.
go_files: $(GO_FILES)
+po/%.po: $(SCM_FILES)
+ xgettext $(XGETTEXT_FLAGS) --output $@ -L scheme $^ --join-existing --omit-header
+
+po/new.po: $(SCM_FILES)
+ xgettext $(XGETTEXT_FLAGS) --output $@ -L scheme $^
+
+localization/%/LC_MESSAGES/calp.mo: po/%.po
+ -@mkdir -p $(shell dirname $@)
+ msgfmt --check -o $@ $<
+
clean:
-$(MAKE) -C static clean
-rm -r obj-*