# Fortran flags
FC=g77
FFLAGS=-fvxt -fno-automatic -Wall -Wno-globals -fbounds-check
# C flags
CC=gcc
CFLAGS=-Wall -O2
CFLADJ=-c

# used libraries 
#LIBS=-L/cern/pro/lib -lkernlib -lpacklib -lgraflib -lmathlib -lnsl
LIBS= `cernlib kernlib packlib graflib mathlib`

template.exe: template-static

# this directive links static libraries
template-static: template.f trk_level2.f
	$(FC) $(FFLAGS) template.f -o template.exe $(TRK_GRND)/lib/libtrk.a $(LIBS) 

# the next directive link dinamyc library (.so)
# NB! in order to link dynamically it must be added the library path to 
# LD_LIBRARY_PATH (in the ./bashrc)
template-dynamic: template.f trk_level2.f
	$(FC) $(FFLAGS) -o template.exe template.f $(LIBS) -L$(TRK_GRND)/lib -ltrk


clean:
	rm -f *.o
	rm -f *.exe
	rm -f *~

