#! /bin/bash
#
gcc -c -g -Wall -I/$HOME/include dirichlet_test.c
if [ $? -ne 0 ]; then
  echo "Compile error."
  exit
fi
#
gcc -o dirichlet_test dirichlet_test.o /$HOME/libc/dirichlet.o -lm
if [ $? -ne 0 ]; then
  echo "Load error."
  exit
fi
rm dirichlet_test.o
#
./dirichlet_test > dirichlet_test.txt
if [ $? -ne 0 ]; then
  echo "Run error."
  exit
fi
rm dirichlet_test
#
gnuplot dirichlet_02_commands.txt
gnuplot dirichlet_03_commands.txt
gnuplot dirichlet_04_commands.txt
gnuplot dirichlet_05_commands.txt
gnuplot dirichlet_10_commands.txt
gnuplot dirichlet_15_commands.txt
gnuplot dirichlet_20_commands.txt
gnuplot dirichlet_25_commands.txt
#
rm *_commands.txt
rm *_data.txt
#
echo "Normal end of execution."
