summaryrefslogtreecommitdiff
path: root/common.mk
diff options
context:
space:
mode:
Diffstat (limited to 'common.mk')
-rw-r--r--common.mk24
1 files changed, 9 insertions, 15 deletions
diff --git a/common.mk b/common.mk
index 68b5d56..33beed6 100644
--- a/common.mk
+++ b/common.mk
@@ -14,22 +14,16 @@ edit = sed -e 's|m4_include(lib/\(.*\))|. $$(librelib \1)|'
# Normalize a .po(t) file
pofmt = msguniq -Fi
+xgettext-keywords-sh += --keyword={_,print}
+xgettext-keywords-sh += --keyword={msg,msg2,warning,error,stat_busy,die}
+xgettext-keywords-sh += --keyword={lock,slock}:3
+
+xgettext-sh = xgettext --omit-header --from-code=UTF-8 -L shell -o -
+xgettext-sh-std = $(xgettext-sh) $(xgettext-keywords-sh) $^
+
pot-remove-wrap = tr '\n' '\r' | sed 's/"\r\s*"//g' | tr '\r' '\n'
html-whitespace-collapse = sed -r -e 's/(\\n|\\t|\t)/ /g' -e 's/ +/ /g'
-define xgettext-prose =
- xgettext --omit-header --from-code=UTF-8 -L shell \
- -k \
- --keyword={prose,bullet,flag:2} \
- -o - $^ | $(pot-remove-wrap) | $(html-whitespace-collapse) | sed '/^#, sh-format/d'
-endef
-define xgettext-main =
- xgettext --omit-header --from-code=UTF-8 -L shell \
- -k \
- --keyword={_,print} \
- --keyword={msg,msg2,warning,error,stat_busy} \
- --keyword={lock,slock}:3 \
- -o - $^
-endef
+xgettext-sh-prose = $(xgettext-sh) -k --keyword={prose,bullet,flag:2} $^ | $(pot-remove-wrap) | $(html-whitespace-collapse) | sed '/^\#, sh-format/d'
# Usage: as a variable
# relative path to `/` from $(bindir)
@@ -88,7 +82,7 @@ build: PHONY $(build_files)
@chmod 755 "$@" || { rm -f -- '$@'; false; }
%.pot: %
- { $(xgettext-main); $(xgettext-prose); } | $(pofmt) > '$@'
+ { $(xgettext-sh-std); $(xgettext-sh-prose); } | $(pofmt) > '$@'
# Install ######################################################################