3
0

usage_compressed 400 B

12345678910111213141516171819
  1. #!/bin/sh
  2. target="$1"
  3. loc="$2"
  4. test "$target" || exit 1
  5. test "$loc" || loc=.
  6. test -x "$loc/usage" || exit 1
  7. test "$SED" || SED=sed
  8. sz=`"$loc/usage" | wc -c` || exit 1
  9. exec >"$target"
  10. echo 'static const char packed_usage[] = '
  11. "$loc/usage" | bzip2 -1 | od -v -t x1 \
  12. | $SED -e 's/^[^ ]*//' -e 's/ \(..\)/\\x\1/g' -e 's/^\(.*\)$/"\1"/'
  13. echo ';'
  14. echo '#define SIZEOF_usage_messages' `expr 0 + $sz`