#!/bin/sh

# ***************************************
# Compilation of FBMath library for Linux
# ***************************************

for f in curfit/*.bas
do
  fbc -c $f
done
ar r libfbmath.a curfit/*.o
rm -f curfit/*.o

for f in equation/*.bas
do
  fbc -c $f
done
ar r libfbmath.a equation/*.o
rm -f equation/*.o

for f in fmath/*.bas
do
  fbc -c $f
done
ar r libfbmath.a fmath/*.o
rm -f fmath/*.o

for f in fourier/*.bas
do
  fbc -c $f
done
ar r libfbmath.a fourier/*.o
rm -f fourier/*.o

for f in integral/*.bas
do
  fbc -c $f
done
ar r libfbmath.a integral/*.o
rm -f integral/*.o

fbc -lib largeint/largeint.bas -i ..

for f in matrices/*.bas
do
  fbc -c $f
done
ar r libfbmath.a matrices/*.o
rm -f matrices/*.o

for f in optim/*.bas
do
  fbc -c $f
done
ar r libfbmath.a optim/*.o
rm -f optim/*.o

for f in plot/*.bas
do
  fbc -c $f
done
ar r libfbmath.a plot/*.o
rm -f plot/*.o

for f in polynom/*.bas
do
  fbc -c $f
done
ar r libfbmath.a polynom/*.o
rm -f polynom/*.o

for f in proba/*.bas
do
  fbc -c $f
done
ar r libfbmath.a proba/*.o
rm -f proba/*.o

for f in random/*.bas
do
  fbc -c $f
done
ar r libfbmath.a random/*.o
rm -f random/*.o

for f in stat/*.bas
do
  fbc -c $f
done
ar r libfbmath.a stat/*.o
rm -f stat/*.o

for f in strings/*.bas
do
  fbc -c $f
done
ar r libfbmath.a strings/*.o
rm -f strings/*.o

mv largeint/*.a ./
ls -l *.a

cp *.a ../
