#!/bin/sh

preprocess() {
	ruby -r erb -e 'puts ERB.new(ARGF.read).result' $1.erb > $1.tmp
	if [ "$?" != 0 ]; then
		echo ""
		echo "** preprocess failed **"
		echo ""
	else
		mv $1.tmp $1
	fi
}

preprocess src/msgpack/type/tuple.hpp
preprocess src/msgpack/type/define.hpp
preprocess src/msgpack/zone.hpp
cp -f ../msgpack/sysdep.h          src/msgpack/
cp -f ../msgpack/pack_define.h     src/msgpack/
cp -f ../msgpack/pack_template.h   src/msgpack/
cp -f ../msgpack/unpack_define.h   src/msgpack/
cp -f ../msgpack/unpack_template.h src/msgpack/

