summaryrefslogtreecommitdiff
path: root/make
diff options
context:
space:
mode:
Diffstat (limited to 'make')
-rw-r--r--make/git.mk20
-rw-r--r--make/po4a.mk13
-rw-r--r--make/rules.mk4
3 files changed, 30 insertions, 7 deletions
diff --git a/make/git.mk b/make/git.mk
index 072617e..2c8c827 100644
--- a/make/git.mk
+++ b/make/git.mk
@@ -7,14 +7,24 @@ branches = $(master)
# local name of origin
origin = origin
-currentbranch = $(shell git branch | grep ^\* | awk '{ print $2 }')
-noncurrentbranches = $(filter-out $(currentbranch),$(branches))
+allbranches = $(sort $(master) $(branches))
+currentbranch := $(shell git branch | grep ^\* | awk '{ print $2 }')
+noncurrentbranches := $(filter-out $(currentbranch),$(branches))
+
+#originbranches := $(shell git branch -r | perl -ne 'm,^.\s+'"$$origin"'/([a-z_]\S+)$, && print "$$1\n"' )
+localbranches := $(shell git branch | perl -ne 'm,^.\s+([a-z_]\S+)$$, && print "$$1\n"' )
update:
git fetch $(origin)
- $(if $(filter $(currentbranch),$(master)),,git branch -f "$(master)" "$(origin)/$(master)" && git checkout "$(master)")
- git pull "$(origin)"
- $(if $(noncurrentbranches),$(foreach branch,$(noncurrentbranches),git branch -f "$(branch)" "$(origin)/$(branch)" && git checkout "$(branch)" && git pull "$(origin)" &&) git checkout "$(master)")
+ for branch in $(filter-out $(localbranches),$(allbranches)); do \
+ git branch $$branch $(origin)/$$branch; \
+ done
+ for branch in $(noncurrentbranches); do \
+ git checkout $$branch; \
+ git pull $(origin); \
+ done
+ git checkout $(master)
+ git pull $(origin)
init:
git init
diff --git a/make/po4a.mk b/make/po4a.mk
index 9a09320..508935c 100644
--- a/make/po4a.mk
+++ b/make/po4a.mk
@@ -1,3 +1,8 @@
+package = PACKAGE
+module = MODULE
+version = VERSION
+locale = LOCALE
+
# override with e.g. htmltemplate when handling non-Markdown files
fileformat = text
@@ -10,6 +15,14 @@ threshold = 100
# potfile: path to POT file
mkpot:
po4a-gettextize -M UTF-8 -L UTF-8 -f "$(fileformat)" -o markdown $(patsubst %,-m %,$(l10nfiles)) -p "$(potfile)"
+ sed -i \
+ -e 's/^# SOME DESCRIPTIVE TITLE/# $(locale) translation of $(module) pages for $(package)./' \
+ -e '/^# This file/ s/PACKAGE/$(package)/' \
+ -e '/^"Project-Id-Version:/ s/PACKAGE/$(package) $(module)/' \
+ -e '/^"Project-Id-Version:/ s/VERSION/$(version)/' \
+ -e '/^"Content-Type:/ s/CHARSET/UTF-8/' \
+ -e '/^"Content-Transfer-Encoding:/ s/ENCODING/8bit/' \
+ "$(potfile)"
# Invoke from root dir of translated files
# masterdir: path to dir containing untranslated files
diff --git a/make/rules.mk b/make/rules.mk
index 8da5f97..38fdbff 100644
--- a/make/rules.mk
+++ b/make/rules.mk
@@ -62,11 +62,11 @@ $(3)_L10NFILES = $$(patsubst $(1)/%,%,$$(shell find $(1) -type f -name '*.$$(fil
MASTER_L10NFILES += $$(patsubst %,$(1)/%,$$($(3)_L10NFILES))
$(podir)/$(3).pot: $(1)
- $(MAKE) -f "$$(CURDIR)/make/po4a.mk" -C "$(1)" fileformat="$$(fileformat)" l10nfiles="$$($(3)_L10NFILES)" potfile="$(CURDIR)/$$@" mkpot; \
+ $(MAKE) -f "$$(CURDIR)/make/po4a.mk" -C "$(1)" package="$(4)" module="$(3)" version="$(5)" locale="LOCALE" fileformat="$$(fileformat)" l10nfiles="$$($(3)_L10NFILES)" potfile="$(CURDIR)/$$@" mkpot; \
.PHONY: $(1)
endef
-$(foreach source,$(SOURCES),$(foreach module,$($(source)_POMODULES),$(eval $(call POT_template,$(masterdir),,$(module),$(source)))))
+$(foreach source,$(SOURCES),$(foreach module,$($(source)_POMODULES),$(eval $(call POT_template,$(masterdir),,$(module),$(source),$($(source)_VERSION)))))