summaryrefslogtreecommitdiff
path: root/applets/usage_compressed
blob: 9da683088faa5d99341d8363f6f13c7a80714e17 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh

target="$1"
loc="$2"

test "$target" || exit 1
test "$loc" || loc=.
test -x "$loc/usage" || exit 1
test "$SED" || SED=sed

sz=`"$loc/usage" | wc -c` || exit 1

exec >"$target"

echo 'static const char packed_usage[] ALIGN1 = '
"$loc/usage" | bzip2 -1 | od -v -t x1 \
| $SED -e 's/^[^ ]*//' -e 's/  *\(..\)/\\x\1/g' -e 's/^\(.*\)$/"\1"/'
echo ';'
echo '#define SIZEOF_usage_messages' `expr 0 + $sz`