#This is the makefile for all spnbox functions.
#It is called by the pntool makefile to create object code for all the functions.

COMPILER=gcc -g

all: actn.o admcon.o asiph.o avpr.o chkcons.o deallocation.o dp.o\
 extendedmatrix.o fvpr.o gcdv.o invar.o ilpadm.o ipslv.o ipsolve.o isadm.o\
 issiph.o linenf.o matrixmath.o MemoryManager.o mroadm.o msplit.o nltrans.o\
 pn2acpn.o pn2eacpn.o reduce.o supervis.o tactn.o liblpsolve55.a

actn.o: actn.c spnbox.h MemoryManager.h matrixmath.h ../pnheaders/general.h  ../pnheaders/matrix.h
	$(COMPILER) -c actn.c

admcon.o: admcon.c spnbox.h matrixmath.h extendedmatrix.h ../pnheaders/general.h ../pnheaders/matrix.h
	$(COMPILER) -c admcon.c
	
asiph.o: asiph.c spnbox.h extendedmatrix.h ../pnheaders/general.h ../pnheaders/matrix.h
	$(COMPILER) -c asiph.c
	
avpr.o: avpr.c ../pnheaders/general.h ../pnheaders/matrix.h
	$(COMPILER) -c avpr.c
	
chkcons.o: chkcons.c spnbox.h MemoryManager.h matrixmath.h ../pnheaders/general.h  ../pnheaders/matrix.h ../pnheaders/pns.h
	$(COMPILER) -c chkcons.c

deallocation.o: deallocation.c spnbox.h ../pnheaders/matrix.h
	$(COMPILER) -c deallocation.c
	
dp.o: dp.c spnbox.h matrixmath.h extendedmatrix.h ../pnheaders/general.h ../pnheaders/matrix.h ../pnheaders/pns.h
	$(COMPILER) -c dp.c
	
dp4.o: dp4.c spnbox.h matrixmath.h extendedmatrix.h ../pnheaders/general.h ../pnheaders/matrix.h ../pnheaders/pns.h
	$(COMPILER) -c dp4.c

extendedmatrix.o: extendedmatrix.c extendedmatrix.h ../pnheaders/general.h  ../pnheaders/matrix.h
	$(COMPILER) -c extendedmatrix.c

fvpr.o: fvpr.c ../pnheaders/general.h ../pnheaders/matrix.h
	$(COMPILER) -c fvpr.c
	
gcdv.o: gcdv.c ../pnheaders/general.h ../pnheaders/matrix.h
	$(COMPILER) -c gcdv.c

invar.o: invar.c spnbox.h matrixmath.h MemoryManager.h extendedmatrix.h  ../pnheaders/general.h ../pnheaders/matrix.h
	$(COMPILER) -c invar.c
	
ilpadm.o: ilpadm.c spnbox.h MemoryManager.h matrixmath.h ../pnheaders/general.h  ../pnheaders/matrix.h ../pnheaders/pns.h
	$(COMPILER) -c ilpadm.c
	
ipslv.o: ipslv.c spnbox.h ../third-party/lp_solve_5.5/lp_lib.h 
	$(COMPILER) -c ipslv.c

ipsolve.o: ipsolve.c spnbox.h matrixmath.h ../pnheaders/general.h  ../pnheaders/matrix.h
	$(COMPILER) -c ipsolve.c
	
isadm.o: isadm.c spnbox.h MemoryManager.h matrixmath.h ../pnheaders/general.h  ../pnheaders/matrix.h
	$(COMPILER) -c isadm.c
	
issiph.o: issiph.c spnbox.h ../pnheaders/general.h ../pnheaders/matrix.h
	$(COMPILER) -c issiph.c

linenf.o: linenf.c spnbox.h MemoryManager.h matrixmath.h ../pnheaders/general.h  ../pnheaders/matrix.h
	$(COMPILER) -c linenf.c

matrixmath.o: matrixmath.c matrixmath.h ../pnheaders/general.h  ../pnheaders/matrix.h
	$(COMPILER) -c matrixmath.c

MemoryManager.o: MemoryManager.c MemoryManager.h ../pnheaders/general.h  ../pnheaders/matrix.h
	$(COMPILER) -c MemoryManager.c

mroadm.o: mroadm.c spnbox.h ../pnheaders/matrix.h ../pnheaders/general.h matrixmath.h
	$(COMPILER) -c mroadm.c
	
msplit.o: msplit.c spnbox.h MemoryManager.h matrixmath.h ../pnheaders/general.h  ../pnheaders/matrix.h
	$(COMPILER) -c msplit.c

nltrans.o: nltrans.c spnbox.h MemoryManager.h ../pnheaders/general.h  ../pnheaders/matrix.h
	$(COMPILER) -c nltrans.c

pn2acpn.o: pn2acpn.c spnbox.h MemoryManager.h matrixmath.h ../pnheaders/general.h  ../pnheaders/matrix.h
	$(COMPILER) -c pn2acpn.c
	
pn2eacpn.o: pn2eacpn.c spnbox.h MemoryManager.h matrixmath.h ../pnheaders/general.h  ../pnheaders/matrix.h
	$(COMPILER) -c pn2eacpn.c

reduce.o: reduce.c spnbox.h ../pnheaders/general.h  ../pnheaders/matrix.h ../pnheaders/pns.h
	$(COMPILER) -c reduce.c
	
supervis.o: supervis.c spnbox.h matrixmath.h ../pnheaders/matrix.h
	$(COMPILER) -c supervis.c

tactn.o: tactn.c spnbox.h ../pnheaders/matrix.h ../pnheaders/pns.h matrixmath.h MemoryManager.h
	$(COMPILER) -c tactn.c
	
liblpsolve55.a: ../third-party/lp_solve_5.5/lpsolve55/liblpsolve55.a
	cp ../third-party/lp_solve_5.5/lpsolve55/liblpsolve55.a liblpsolve55.a
	
../third-party/lp_solve_5.5/lpsolve55/liblpsolve55.a:
	cd ../third-party/lp_solve_5.5; make -f Makefile.Linux lib

clean: 
	rm -fv *.o *.a
	cd ../third-party/lp_solve_5.5; make -f Makefile.Linux clean
	
clean-partial:
	rm -fv *.o
	
