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

PCX_LIB   =  libPCx.a
MYSOLVER_LIB = ../mysolver/libmysolver.a
F2C_LIB   =  ../F2C/f2c.a

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


CFLAGS = -O -D$(PCx_ARCH) -I../F2C
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) Ng-Peyton.o $(MISC_OBJS) $(NG_LIB)
	$(CC) $(LFLAGS) main.o  Ng-Peyton.o $(PCX_LIB) $(MISC_OBJS) $(NG_LIB) $(F2C_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)
	$(CC) $(LFLAGS) main.o wssmp.o $(PCX_LIB) $(MISC_OBJS) \
          $(WSSMP_LIB) $(F2C_LIB) -o ../PCx -lm

# template for other solvers

PCx_yoursolver: main.o $(PCX_LIB) musolver.o $(MISC_OBJS) $(MYSOLVER_LIB)
	$(CC) $(LFLAGS) main.o $(PCX_LIB) mysolver.o $(MISC_OBJS) \
        $(MYSOLVER_LIB) $(F2C_LIB) -o ../PCx -lm

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Ng-Peyton.o: Ng-Peyton.c main.h memory.h hash.h solver.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

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

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














