# change compiler if not using gfortran
FC = gfortran
FFLAGS = -O2 -shared -fPIC 

BLD = ld -shared -fPIC 

# Set lists of potential routines to be compiled
# replace mysrf.o with names of routines
potentials = mysrf.o \
             mysrf1.o

libusrf.so: $(potentials)
	$(FC) $(FFLAGS) -c usersrf.f90 
	$(BLD) -o libusrf.so usersrf.o $(potentials) 

# Pattern rule to make %.o file
.SUFFIXES: .o .f .f90 

.f90.o :
	$(FC) -c $(FFLAGS) $<

.f.o :
	$(FC) -c $(FFLAGS) $<


clean:
	rm -rf *.o
	rm -rf *.so
