# Makefile for octave version of semidef
# type in "make" or "make all" to create the .oct file.
# type in "make demo" to create the .oct file and run the demo

%.oct : %.cc $(OCT_LIBS) ocst.h
	@echo "making $@ from $<"
	mkoctfile $<  -locst -lm

%.o : %.cc ocst.h
	@echo "making $@ from $<"
	mkoctfile $<
	rm -f $*.oct

OCT_FILES = sp.oct 
SP_DEP= sp.cc get_matrix.o get_real_scalar.o get_vector.o sp_src.c \
	dgels.f    dopgtr.f   dspgv.f    dsptrd.f   lse.f \
	dlansp.f   dpptrf.f   dspmv.f    dtpmv.f    lce.f \
	dlantr.f   dspev.f    dspr.f     dtpsv.f    lde.f \
	dlatrs.f   dspgst.f   dspr2.f    dtrcon.f 

all: $(OCT_FILES)

demo: $(OCT_FILES)
	@echo "Type in \"demosp\" at the octave prompt"
	octave

sp.oct: $(SP_DEP) ocst.h
	mkoctfile $(SP_DEP)

clean:
	rm -f *.o *.oct *.a *.so *.so.1 core octave-core so_locations

