Project

General

Profile

Revision 219

xpm to xpm2

View differences:

xpm_to_xpm2.sh
1 1
cd $1
2 2
echo "#include \"xpm_utils.h\"" > convert.c
3 3
for f in xpm/*.xpm; do
4
    echo "#include \"$f\"" >> convert.c 
4
    echo "#include \"$f\"" >> convert.c
5 5
done
6 6
echo "int main(){" >> convert.c
7 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/')"
8 9
    s=${f:4:-4}
9
    echo "    xpm_save_as_xpm2($s,\"xpm2/$s.xpm2\");" >> convert.c
10
    echo "    xpm_save_as_xpm2((const char **)$xpmname,\"xpm2/$s.xpm2\");" >> convert.c
10 11
done
11 12
echo "    return 0;" >> convert.c
12 13
echo "}" >> convert.c
13
gcc -I../../include ../../src/xpm_utils.c convert.c -o convert.app
14
gcc -I/media/DATA/VirtualBox_VMs/MINIX-LCOM/shared/proj/include /media/DATA/VirtualBox_VMs/MINIX-LCOM/shared/proj/src/xpm_utils.c convert.c -o convert.app
14 15
rm -rf xpm2
15 16
mkdir xpm2
16 17
./convert.app

Also available in: Unified diff