#!/bin/sh
# $XTermId: make-xpms,v 1.1 2012/08/24 11:30:34 tom Exp $
# some files are generated from other icons...
for name in mini.xterm xterm
do
	target=${name}.xpms
	NAME=`echo "$target" | sed -e 's/\./_/g'`
	LIST=
	echo "** creating $target"
	rm -f $target
	echo "/* @XTermId@ */" | sed -e 's/@/$/g' >$target
	echo "/* generated by $0 $* */" >>$target
	echo "/* vile:xpmmode */" >>$target
	for source in ${name}_*x*.xpm
	do
		echo ".. from $source"
		PART=`echo "$source" | sed -e 's/\./_/g'`
		test -n "$LIST" && LIST="$LIST, "
		LIST="$LIST $PART"
		sed -e 's/char \*/const char * const/' $source >>$target
	done
	echo "static const char * const *const $NAME[] = { $LIST };" >>$target
done
