#################################################################
#
# Makefile for UKRmol-in codes
#
# Possible invocations:
# make [with optional arguments]
# make clean
# (removes .o and .mod files)
# make cleanall
# (removes .o, .mod and executables)
#
# This Makefile should not need to be edited for use on different 
# machines and/or with different compilers, etc.
# Default definitions of system-specific variables (the compiler, 
# compiler flags, linear algebra libraries) can be found below.
# These settings can be overridden via command-line arguments to 
# "make", or by setting the relevant variables appropriately in a 
# file "make.inc" (copy, paste and edit the lines below that you 
# want to change)
#
#################################################################

#################################################################
# Default settings for the system-dependent variables
COMP=ifort -w -mkl -i8
LINK=ifort -static -mkl -i8
OPT=-O3
NOOPT=-O0 
# The following libraries should be included: 
# Arpack here (compiled with sequential mkl): 
#################################################################

# The following include line must come after the system-specific defaults are set
# The leading "-" means that make will continue if the named file cannot be found
# (i.e. we wish to keep all the default settings)
-include make.inc


LIB=../../lib/libutil.a

SOURCESF =  $(filter-out main.f,$(wildcard [^~]*.f*))

OBJECTS =	\
	${SOURCESF:.f=.o} \
	${SOURCESF:.f90=.o} 


all: $(LIB) 

%.o: %.f
	$(COMP) $(OPT) -c $<

%.o: %.f90
	$(COMP) $(OPT) -c $<

interpolate.o: bspline90_22.o interpolate.f90 
	 $(COMP) $(OPT) -c interpolate.f90 

$(LIB):  $(OBJECTS) 
	ar -rv $(LIB) $(OBJECTS)
	rm -f *.o *~ 
 
	 




