# 
#   makefile for the post processing program         plot
# 
################################################################
#
#    add the name of  YOUR  compiler/operating system
#    and modify the compiler options FFLAGS  ---   if necessary   
#
#    NOTE: the executable will be copied to the parent 
#          directory  (../)  of your recent working directory
#
################################################################
#ostype = case "`uname -s`" in \
#           (*inux*)  echo Linux   ;; \
#           (*OSF*)   echo OSF1    ;; \
#           (*ygwin*) echo Cygwin  ;; \
#         esac

# force evaluation now 
# not available in standard make (under OSF1)
#OSTYPE = $(shell $(ostype))
################################################################
linuxFC = ifort
linux-gnuFC = ifort
OSF1FC = f77 
CygwinFC = g77
#FC=$($(OSTYPE)FC)
FC=ifort -O2
#FC=ifort -O0 -check all -traceback
################################################################
# set to 1 if dislin library is available and should be used
# if set to 0 plot programm is compiled without calls to dislin
USEDISLIN = 1
USEDISLIN = 0

DISLIN = /usr/local/dislin
DISLINLIB0 =
DISLINLIB1 = $(DISLIN)/libdislin_d.so.8

RM = rm -f
CP = cp

BINDIR = ..
VERS   = _$(OSTYPE)
VERS   = _linux-gnu

FFLAGS = -c  -g -check all -O0 -traceback
FFLAGS = -c  
LFLAGS = 
LIBS   = $(DISLINLIB$(USEDISLIN))


.SUFFIXES: .o .f

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


all: plot


# program modules used 

PLOT = inigaubrd.o plotlccurves.o  scalen.o plotclxps.o \
broaden.o inilorbrd.o plotdos.o plotnrxas.o plotrxes.o  \
plotkapdos.o plotpolar.o plotbsf.o plotnraesaps.o \
plot.o plotrxas.o  rdhead.o rdhead1.o wcorehole.o   txttext.o \
cpr4vec.o plotband.o plotxps.o vecgaubrd.o xmgr.o \
fillup.o plotcurves.o rdexpdata.o veclorbrd.o  xraymoke.o \
findextr.o  plotexp.o rdrxas.o ylag.o plotsprvbxps.o \
openfiles.o kwposfil.o scaninp.o table.o cnvtouc.o\
plotsprcvvaes.o plotcompton.o plotsprvbarp.o plotbsf_spol.o\
creategnuplotbsf.o createxmv.o createdislin$(USEDISLIN).o \
plotspec.o


plot: $(PLOT)
	$(FC) $(LFLAGS) $(LIBS) -o $@ $(PLOT)
	-$(CP) $@ $(BINDIR)/plot$(VERS)

clean:
	$(RM) *.o *~ plot $(BINDIR)/plot$(VERS) 

