#!/bin/bash
OPS='-O'

echo Generating Word Lists
cat src/words | scripts/wordgen.pl src/word_gen
cd src

echo Compiling utils.c
gcc $OPS -c utils.c -o ../tmp/utils.o
echo Compiling hash-tree.c
gcc $OPS -c hash-tree.c -o ../tmp/hash-tree.o
echo Compiling stats.c
gcc $OPS -c stats.c -o ../tmp/stats.o
echo Compiling actions.c
gcc $OPS -c actions.c -o ../tmp/actions.o
echo Compiling words.c
gcc $OPS -c words.c -o ../tmp/words.o
echo Compiling word_gen.c
gcc $OPS -c word_gen.c -o ../tmp/word_gen.o
echo Compiling rcon.c
gcc $OPS -c rcon.c -o ../tmp/rcon.o
echo Compiling bot.c
gcc $OPS -c bot.c -o ../tmp/bot.o

cd ..

echo Building and Linking "bot"
gcc $OPS tmp/bot.o tmp/words.o tmp/word_gen.o tmp/utils.o tmp/stats.o tmp/actions.o tmp/hash-tree.o tmp/rcon.o -o bot

echo Done ./bot
