# Makefile to compile READOUT
#
#Compiler options
COMP = ifort -c -warn all

# Name of the program
PROG = READOUT

# Linker options
LINK = ifort -static-libcxa -o

# Names of object files
OBJS = main.o readout_rch.o write_rch.o readout_bsb.o write_bsb.o \
       readout_sbs.o read_cod.o write_sbs.o

# Names of modules
MOD = globals.mod

# Rules for make
$(PROG) : $(OBJS)
	$(LINK) $(PROG) $(OBJS)

main.o : main.f90 globals.f90
	$(COMP) main.f90

readout_rch.o : readout_rch.f90
	$(COMP) readout_rch.f90

write_rch.o : write_rch.f90
	$(COMP) write_rch.f90

readout_bsb.o : readout_bsb.f90
	$(COMP) readout_bsb.f90

write_bsb.o : write_bsb.f90
	$(COMP) write_bsb.f90

readout_sbs.o : readout_sbs.f90
	$(COMP) readout_sbs.f90

write_sbs.o : write_sbs.f90
	$(COMP) write_sbs.f90

read_cod.o : read_cod.f90
	$(COMP) read_cod.f90

clean:
	rm $(PROG) $(OBJS) $(MOD)
