# Makefile for compiling and testing Mathomatic with Cygwin for Windows.

VERSION		= `cat VERSION`
CFLAGS		= -O -DCYGWIN -DVERSION=\"$(VERSION)\"
LDFLAGS		= 
LIBS		= -lm

CFLAGS		+= -DREADLINE
LIBS		+= -lreadline -lcurses

AOUT		= mathomatic.exe
OBJECTS		= main.o globals.o am.o solve.o help.o parse.o cmds.o simplify.o factor.o super.o \
		  unfactor.o poly.o diff.o integrate.o complex.o complex_lib.o list.o gcd.o factor_int.o

all: $(AOUT)
	@echo Make completed.

check test:
	cd tests && time ../$(AOUT) -t all 0<&- >test.out && fc all.out test.out
	@echo All tests passed.

baseline:
	cd tests && ../$(AOUT) -t all 0<&- >all.out

$(OBJECTS): includes.h am.h externs.h complex.h proto.h VERSION

$(AOUT): $(OBJECTS)
	$(CC) $(LDFLAGS) $(OBJECTS) $(LIBS) -o $(AOUT)

clean:
	rm -f *.o
	rm -f lib/*.o


syntax highlighted by Code2HTML, v. 0.9.1