diff options
Diffstat (limited to 'src/lib/Makefile')
-rw-r--r-- | src/lib/Makefile | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/lib/Makefile b/src/lib/Makefile new file mode 100644 index 0000000..9d52440 --- /dev/null +++ b/src/lib/Makefile @@ -0,0 +1,45 @@ +include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk +include $(topsrcdir)/build-aux/Makefile.head.mk + +libretools-libs += common.sh conf.sh +devtools-files = common.sh.in + +# Build ############################################################## + +$(outdir)/conf.sh: $(var)sysconfdir $(var)pkgconfdir + +$(outdir)/common.sh: $(outdir)/%: $(srcdir)/%.in $(srcdir)/%.head $(srcdir)/%.tail $(outdir)/Makefile + @echo "OUT $@" + @{ \ + cat '$(<D)/$*.head' && \ + echo && \ + sed -r \ + -e '/encoding problem/d;/LANG=/d' \ + -e 's/mesg=\$$(.)/mesg="$$(_ "$$\1")"/' \ + -e 's/gettext /_l _ /g' \ + -e "s/^(\s+)(msg|error) '/\1_l \2 '/" \ + -e 's|lock\(\)\s*\{|lock()\n{|' \ + '$(<D)/$*.in' && \ + echo && \ + cat '$(<D)/$*.tail' && \ + :; } > '$@' + +# Translate ########################################################## + +$(outdir)/blacklist.sh.pot: $(srcdir)/blacklist.sh $(srcdir)/librexgettext + @echo "OUT $@" + @{ \ + sed -n '/^# Usage:/,/()/{ /^#/ { =; p; } }' $< | \ + sed -r -e 's/^# (.*)/msgid "\1"\nmsgstr ""\n/' \ + -e 's|^[0-9]*$$|#. embedded usage text\n#: $<:&|' && \ + $(<D)/librexgettext --simple=_l:2 $< && \ + :; } | $(pofmt) > $@ +$(outdir)/common.sh.pot : LIBREXGETTEXT_FLAGS += --simple=_l:2 +$(outdir)/conf.sh.pot : LIBREXGETTEXT_FLAGS += --simple=_l:2 +$(outdir)/librelib.pot : LIBREXGETTEXT_FLAGS += --simple=_l:2 +$(outdir)/messages.sh.pot : LIBREXGETTEXT_FLAGS += --simple=_l:2 +$(outdir)/librexgettext.pot: LIBREXGETTEXT_FLAGS += --simple=errusage + +###################################################################### + +include $(topsrcdir)/build-aux/Makefile.tail.mk |