root / proj / src / helpers / xpm_to_xpm2.sh @ 379
History | View | Annotate | Download (680 Bytes)
1 |
cd $1 |
---|---|
2 |
echo "#include \"xpm_utils.h\"" > convert.c |
3 |
for f in xpm/*.xpm; do |
4 |
echo "#include \"$f\"" >> convert.c |
5 |
done |
6 |
echo "int main(){" >> convert.c |
7 |
for f in xpm/*.xpm; do |
8 |
xpmname="$(cat $f | grep -oP 'char *\* *[a-zA-Z0-9_]*' | sed 's/char *\* *\([a-zA-Z0-9_]*\)/\1/')" |
9 |
s=${f:4:-4} |
10 |
echo " xpm_save_as_xpm2((const char **)$xpmname,\"xpm2/$s.xpm2\");" >> convert.c |
11 |
done |
12 |
echo " return 0;" >> convert.c |
13 |
echo "}" >> convert.c |
14 |
gcc -I/media/DATA/VirtualBox_VMs/MINIX-LCOM/shared/proj/libs/utils/include /media/DATA/VirtualBox_VMs/MINIX-LCOM/shared/proj/libs/utils/src/xpm_utils.c convert.c -o convert.app |
15 |
rm -rf xpm2 |
16 |
mkdir xpm2 |
17 |
./convert.app |
18 |
rm convert.c convert.app |