#  Main body of the installation makefile for CUTEst STATS interface

#  Nick Gould, for GALAHAD productions
#  This version: 2023-11-23

#  include standard CUTEst makefile defaults before package-specifics

include $(CUTEST)/src/makedefs/defaults

#  ===========================================================================
#  ====================  package-dependent parts  ============================
#  ===========================================================================

#  package name 

PACKAGE = STATS
package = stats

#  ===========================================================================
#  =================  end of package-dependent parts  ========================
#  ===========================================================================

#  include standard CUTEst makefile definitions

include $(CUTEST)/src/makedefs/definitions

#  include compilation and run instructions

include $(CUTEST)/src/makedefs/instructions

#  select specific run test

# run example tests

run_test: tools test_cutest $(OBJ)/$(package)_main.o
	echo " Test of unconstrained $(package)"
	cd $(OBJ) ; $(FORTRAN) $(RUNFFLAGS) $(SPECIAL) -o run_test \
            $(package)_main.o $(U_TEST) -L$(OBJ) $(LIBS)
	ln -fs $(CUTEST)/src/test/u_OUTSDIF.d ../$(package)/OUTSDIF.d
	- $(OBJ)/run_test >& ../$(package)/u_test.output
	cat ../$(package)/u_test.output
	rm $(OBJ)/run_test ../$(package)/OUTSDIF.d
	echo " Test of constrained $(package)"
	cd $(OBJ) ; $(FORTRAN) $(RUNFFLAGS) $(SPECIAL) -o run_test \
            $(package)_main.o $(C_TEST) -L$(OBJ) $(LIBS)
	ln -fs $(CUTEST)/src/test/c_OUTSDIF.d ../$(package)/OUTSDIF.d
	- $(OBJ)/run_test >& ../$(package)/c_test.output
	cat ../$(package)/c_test.output
	rm $(OBJ)/run_test ../$(package)/OUTSDIF.d

#  include standard package compilation instructions

include $(CUTEST)/src/makedefs/compile
