diff options
Diffstat (limited to 'src/lib/Makefile')
-rw-r--r-- | src/lib/Makefile | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/lib/Makefile b/src/lib/Makefile new file mode 100644 index 0000000..45fd330 --- /dev/null +++ b/src/lib/Makefile @@ -0,0 +1,30 @@ +copy_files = common.sh.in +libexecs = $(filter-out librelib,$(wildcard libre*)) +# 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")"/' '$*.in' && \ + echo && \ + cat '$*.bottom' && \ + :; } > '$@' + +# Translate ########################################################## + +pot: libreblacklist.pot common.sh.pot librelib.pot + +libreblacklist.pot: libreblacklist + { \ + sed -n '/^# Usage:/,/()/{ /^#/ { =; p; } }' $< | sed -r -e 's/^# (.*)/msgid "\1"/' -e 's/^[0-9]*$$/#. embedded usage text\n#: $<:&/'; \ + sed -rn '/print /{ =; s/\s*print "([^"]*)".*/msgid "\1"/p; }' $< | sed 's/^[0-9]*$$/#. print\n#: $<:&/' ; \ + } | sed 's/^msgid .*/&\nmsgstr ""\n/' > $@ +common.sh.pot: common.sh + xgettext --omit-header -i --from-code=UTF-8 -L shell -o $@ $< |