summaryrefslogtreecommitdiff
path: root/common.mk
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2014-06-27 19:33:06 -0400
committerLuke Shumaker <LukeShu@sbcglobal.net>2014-06-27 19:33:06 -0400
commitd7763f0a6cb902e969305d02a18ec13d84227d9d (patch)
treecc343ee3a753bf60aaedc9298c215703c30756e7 /common.mk
parentfb94599dcea71cdf2cb448e1545cfbdc526288a1 (diff)
Add librexgettext, to make generating .pot file easy for librelib users.
I don't like how much longer this is than the Makefile, but most of it is option parsing and usage text.
Diffstat (limited to 'common.mk')
-rw-r--r--common.mk15
1 files changed, 2 insertions, 13 deletions
diff --git a/common.mk b/common.mk
index f8421d4..44896e2 100644
--- a/common.mk
+++ b/common.mk
@@ -22,17 +22,6 @@ indent = emacs --batch $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'
-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)
# used for symlinking libexec files
@@ -112,8 +101,8 @@ pot: everything.pot
everything.pot: $(pot_files)
cat $^ | $(pofmt) > '$@'
-%.pot: %
- { $(xgettext-sh-std); $(xgettext-sh-prose); } | $(pofmt) > '$@'
+%.pot: % $(topdir)/src/lib/librexgettext
+ $(topdir)/src/lib/librexgettext $(LIBREXGETTEXT_FLAGS) $< > '$@'
# Install ######################################################################