#!/bin/bash

../Foundation/runswig Framework Foundation

module="FWOldSpringhead"
makefile="${module}Stub.mak.txt"

srcimp="../Framework/FWOldSpringheadNodeHandler.h"

echo src files: $srcimp

topdir="../.."

SWIG_LIB=$topdir/bin/swig/Lib
export SWIG_LIB

echo "#	Do not edit. runswigframework will update this file." > $module.i
echo "%module ${module}" >> $module.i
echo "%include \"../../include/Springhead.h\"" >> $module.i
echo "%include \"../../include/Base/Env.h\"" >> $module.i
echo "%include \"../../src/Base/BaseDebug.h\"" >> $module.i
echo "%include \"../../src/Foundation/UTTypeDesc.h\"" >> $module.i

for p in $srcimp
do
  echo "%include \"$p\"" >> $module.i
done

echo "#	Do not edit. runswigframework will update this file." > $makefile
echo "all: ${module}Stub.cpp" >> $makefile
echo "${module}Stub.cpp: $srcimp" >> $makefile
echo "	${topdir}/bin/swig/swig -spr -w312,401,402 -DSWIG_OLDNODEHANDLER -c++ -v ${module}.i" >> $makefile
echo "	cp Spr${module}Decl.hpp ../../include/${module}" >> $makefile

make -f$makefile