copy_files = common.sh.in libexecs = $(filter-out librelib,$(progs)) # include common.sh in libs explicitly, because it might not exist yet # when the wildcard is performed libs = $(sort $(wildcard *.sh) common.sh) include ../../common.mk # Build ############################################################## common.sh: %: %.in %.top Makefile @echo "GEN $@" @{ \ cat '$*.top' && \ 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{|' \ '$*.in' && \ echo && \ cat '$*.bottom' && \ :; } > '$@' # Translate ########################################################## LIBREXGETTEXT_FLAGS += --simple=_l:2 libreblacklist.pot: libreblacklist librexgettext { \ sed -n '/^# Usage:/,/()/{ /^#/ { =; p; } }' $< | \ sed -r -e 's/^# (.*)/msgid "\1"\nmsgstr ""\n/' \ -e 's/^[0-9]*$$/#. embedded usage text\n#: $<:&/'; \ ./librexgettext $<; \ } | $(pofmt) > $@ librexgettext.pot: LIBREXGETTEXT_FLAGS += --simple=errusage