TARGET= mps2eq
MANPAGE=$(TARGET).1
OBJECTS= mps2eq.o
INCLUDES=patchlevel.h
CC= cc
# you might need to add something about the sources being ANSI
CFLAGS= -O
TESTFILES= bore3d.mps share1b.mps stein9.mps stein9b.mps test.mps test2.mps

# change this when you like. They are only used with make install.
INSTALLDIR=/usr/local/bin
MANDIR=/usr/local/man/man1

$(TARGET) : $(OBJECTS) 
	$(CC) $(CFLAGS) -o $(TARGET) $(OBJECTS) 

$(OBJECTS) : $(INCLUDES)

install:
	cp ${TARGET} ${INSTALLDIR}
	cp ${MANPAGE} ${MANDIR}

$(TARGET).man : $(MANPAGE)
	nroff -man $(MANPAGE) > $(TARGET).man

clean:
	/bin/rm -f $(OBJECTS) *.bak $(TARGET) TAGS

TAGS:
	etags *.[chly]

test:
	for i in $(TESTFILES); do\
		./$(TARGET) < $$i > xxx.tmp;\
		if diff xxx.tmp `basename $$i .mps`.lp > /dev/null; then\
			echo "$$i gives the correct result";\
		else\
			echo "$$i gives different result, please check";\
		fi;\
	done;\
	rm xxx.tmp
