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