aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-02-22 11:52:33 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2022-02-22 21:08:41 +0100
commitd4759a55f59bac49f3912305f09ca71666d122be (patch)
treeeee2e763beaf9ffe8fe56ce0274750e481a56485 /Makefile
parentInitial swedish translation. (diff)
downloadcalp-d4759a55f59bac49f3912305f09ca71666d122be.tar.gz
calp-d4759a55f59bac49f3912305f09ca71666d122be.tar.xz
Update makefile for localizations.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile18
1 files changed, 17 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 978ecc85..fbbfbc6c 100644
--- a/Makefile
+++ b/Makefile
@@ -13,11 +13,27 @@ 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)
+
+XGETTEXT_FLAGS = --from-code=UTF-8 --add-comments --indent -k_
static:
$(MAKE) -C static
+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 $@ $<
+
obj/%.go: module/%.scm
@mkdir -p obj
@echo guild compile $<