# Makefile for MINOS compiling test problems in minos/test.
# Uses options defined in ../Makefile.defs.
# make minost          compiles with FFLAGSopt and links to libminos.so.
# make minost DBG=dbg  compiles with FFLAGSdbg and links to libminosdbg.so.
#
# 06 Dec 2002: Makefiles reorganized by Michael Friedlander.
# 18 Aug 2005: Keep a copy of ../src/mi00main.f and ../src/mi05funs.f here.

include ../Makefile.defs

SRC         = ../src
LIB         = ../lib

  FFLAGS    = $(FFLAGSopt) $(LIBDIR)   # Default is optimize
  LIBMINOS  = -L$(LIB) -lminos
ifeq ($(DBG),dbg)                      # DBG=dbg specified
  FFLAGS    = $(FFLAGSdbg) $(LIBDIR)
  LIBMINOS  = -L$(LIB) -lminosdbg
endif

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

minos       = mi00main.o mi05funs.o
minost      = minost.o   mi05funs.o
minost2     = minost2.o  mi05funs.o
minost3     = minost3.o  mi05funs.o
minosm      = minosm.o   mi05funs.o
ramsey      = ramsey.o   mi05funs.o
spring      = spring.o

minos:                        $(minos)
	$(FC) $(FFLAGS) -o $@ $(minos)   $(LIBMINOS)

minost:                       $(minost)
	$(FC) $(FFLAGS) -o $@ $(minost)  $(LIBMINOS)

minost2:                      $(minost2)
	$(FC) $(FFLAGS) -o $@ $(minost2) $(LIBMINOS)

minost3:                      $(minost3)
	$(FC) $(FFLAGS) -o $@ $(minost3) $(LIBMINOS)

minosm:                       $(minosm)
	$(FC) $(FFLAGS) -o $@ $(minosm)  $(LIBMINOS)

ramsey:                       $(ramsey)
	$(FC) $(FFLAGS) -o $@ $(ramsey)  $(LIBMINOS)

spring:                       $(spring)
	$(FC) $(FFLAGS) -o $@ $(spring)  $(LIBMINOS)

clean:
	rm -f *.o

veryclean:
	make clean
	rm -f minos minost minost2 minost3 minosm
	rm -f ramsey spring
