
OBJS = presolve.o PCx2.o readmps.o lpmps.o memory.o hash.o \
       parameters.o split.o io.o timers.o PCx.o solve.o \
       dcolumns.o wrappers.o basics.o scale.o lp.o

PCX_LIB   =  libPCx.a
MYSOLVER_LIB = ../mysolver/libmysolver.a

#NG_LIB    is defined in the build script
#WSSMP_LIB is defined in the build script

FORTRAN = ${FC}
CFLAGS = -O -D$(PCx_ARCH)
#CFLAGS = -g -D$(PCx_ARCH)
FFLAGS = -O
LFLAGS = -O

include ../MAKEARCH/$(PCx_ARCH).make
# MISC_OBJS is defined in architecture-specific makefile 

# this is still the default:
PCx_NgPeyton: main.o $(PCX_LIB) blkLVL.o Ng-Peyton.o $(MISC_OBJS) $(NG_LIB)
	$(FORTRAN) $(LFLAGS) main.o blkLVL.o Ng-Peyton.o $(PCX_LIB) \
	  $(MISC_OBJS) $(NG_LIB) -o ../PCx -lm

# might have to add the parameter -bmaxdata:44000000 for large applications.
# (or with en even larger number)
PCx_wssmp: main.o $(PCX_LIB) wssmp.o $(MISC_OBJS) $(WSSMP_LIB)
	$(FORTRAN) $(LFLAGS) main.o $(PCX_LIB) wssmp.o $(MISC_OBJS) \
	  $(WSSMP_LIB) -o ../PCx -lm

# template for other solvers
PCx_mysolver: main.o $(PCX_LIB) mysolver.o $(MISC_OBJS) $(MYSOLVER_LIB)
	$(CC) $(LFLAGS) main.o $(PCX_LIB) mysolver.o $(MISC_OBJS) \
	  $(MYSOLVER_LIB) -o ../PCx -lm

clean:
	/bin/rm -f *.o $(PCX_LIB) ../PCx

$(PCX_LIB): $(OBJS)
	ar r $(PCX_LIB) $(OBJS)
	$(RANLIB) $(PCX_LIB)

PCx.o: PCx.c main.h memory.h hash.h
	${CC} ${CFLAGS} -c PCx.c

PCx2.o: PCx2.c main.h memory.h hash.h
	${CC} ${CFLAGS} -c PCx2.c

basics.o: basics.c memory.h
	${CC} ${CFLAGS} -c basics.c

Ng-Peyton.o: Ng-Peyton.c main.h memory.h hash.h solver.h Ng-Peyton.h
	${CC} ${CFLAGS} -c Ng-Peyton.c

wssmp.o: wssmp.c main.h memory.h hash.h solver.h
	${CC} ${CFLAGS} -c wssmp.c

# you need to input the dependencies and compilation commands for
# your linear equations solver here. User the lines above for
# Ng-Peyton.o and wssmp.o as a guide.

mysolver.o: # specify your requirements here
	# specify compilation command here

dcolumns.o: dcolumns.c main.h memory.h hash.h
	${CC} ${CFLAGS} -c dcolumns.c

diagnostics.o: diagnostics.c main.h memory.h hash.h
	${CC} ${CFLAGS} -c diagnostics.c

hash.o: hash.c memory.h
	${CC} ${CFLAGS} -c hash.c

io.o: io.c main.h memory.h hash.h pre.h
	${CC} ${CFLAGS} -c io.c

lp.o: lp.c main.h memory.h hash.h
	${CC} ${CFLAGS} -c lp.c

lpmps.o: lpmps.c main.h memory.h hash.h
	${CC} ${CFLAGS} -c lpmps.c

main.o: main.c main.h memory.h hash.h pre.h
	${CC} ${CFLAGS} -c main.c

memory.o: memory.c main.h memory.h hash.h
	${CC} ${CFLAGS} -c memory.c

parameters.o: parameters.c main.h memory.h hash.h
	${CC} ${CFLAGS} -c parameters.c

presolve.o: presolve.c main.h memory.h hash.h pre.h
	${CC} ${CFLAGS} -c presolve.c

readmps.o: readmps.c main.h memory.h hash.h
	${CC} ${CFLAGS} -c readmps.c

scale.o: scale.c main.h memory.h hash.h
	${CC} ${CFLAGS} -c scale.c

solve.o: solve.c main.h memory.h hash.h
	${CC} ${CFLAGS} -c solve.c

split.o: split.c main.h memory.h hash.h
	${CC} ${CFLAGS} -c split.c

timers.o: timers.c 
	${CC} ${CFLAGS} -c timers.c

wrappers.o: wrappers.c main.h memory.h hash.h
	${CC} ${CFLAGS} -c wrappers.c

writemps.o: writemps.c main.h memory.h hash.h
	${CC} ${CFLAGS} -c writemps.c














