echo "A Forth Compiler in SED"
echo "(c)2003 Charles Childers"
echo "There is no warranty!"
echo "---------------------------------------------------------------"
echo "Preparing $1 for compilation"
grep -h \  $1 $2 $3 $4 $5 | sed -f ~/sedforth/framework/forth.sed >$1.asm.1

echo "Generating source code"
cp ~/sedforth/framework/skeleton $1.asm
cat $1.asm.1 >>$1.asm
cat ~/sedforth/framework/libretro >>$1.asm

echo "Compiling into Linux Kernel module"
nasm -f elf $1.asm -g -o $1.obj -DMODULE
ld $1.obj -o $1.o -r

echo "Cleaning up..."
rm $1.asm.1 $1.obj

