#!/bin/bash

FC=gfortran
OPT="-wX -c" 

$FC \
$OPT \
gms_datatype.f90 \
model_info.f90 \
mem_manager.f90 \
gms_assign.f90 \
gms_assign2.f90 \
gms_asym.f90 \
gms_cyclic.f90 \
gms_def_var.f90 \
gms_get.f90  \
gms_input_var.f90 \
gms_input_func_var.f90 \
gms_math_derivative.f90 \
gms_math_divide.f90 \
gms_math_function.f90 \
gms_math_bar.f90 \
gms_math_minus.f90 \
gms_math_plus.f90 \
gms_math_times.f90 \
gms_math_power.f90 \
gms_math_mean.f90 \
gms_math_cmean.f90 \
gms_position.f90 \
gms_size.f90 \
gms_sym.f90 \
gms_size_all.f90 \
gms_get_all.f90 \
gms_position_all.f90 \
lower_boundary_noslip.f90 \
lower_boundary_slip.f90 \
upper_boundary_noslip.f90 \
upper_boundary_slip.f90 \
same_value_boundary.f90 \
gms_math_upwind1.f90 \
gms_math_upwind3.f90 \
gms.f90 \

ar -crvs libgms.a *.o 
mv *.mod /usr/local/gms-gfortran/include/
mv libgms.a /usr/local/gms-gfortran/lib/
rm -f *.o
