CC = gcc -Wall -O2

# comment the following two lines and uncomment the one after to get rid of
# readline 
CFLAGS= -DDEBUG  #-DFORBES

#YFLAGS = -d	 # force creation of ytab.h

INTOBJS = i1.o i2.o i3.o i5I.o i5R.o i6R.o i8.o menu.o i5m.o i6I.o lll.o i9.o \
	i7I.o lllgcd.o lllhermi.o collatz.o readme.o primepow.o

FUNCOBJS = primes1.o mpqsieve.o qres.o reduce.o binary.o utility.o elliptic.o \
	cubicr.o

CALCOBJS = parse.o symbol.o init.o func.o nfunc.o rsa.o 

MOREOBJS = roots.o pI.o stack.o wrappers.o

OBJS = trial.o $(FUNCOBJS) $(CALCOBJS) $(MOREOBJS) $(INTOBJS) 

calc: $(OBJS) 
	$(CC) -o $@ $(OBJS) $(LIBS) 

calc.exe: calc
	coff2exe -s c:/djgpp/bin/go32.exe calc

trial.o $(INTOBJS) $(FUNCOBJS) $(CALCOBJS): integer.h fun.h

init.o symbol.o: calc.h ytab.h integer.h fun.h #dependencies

#dependencies of MOREOBJS
roots.o: integer.h fun.h roots.h
pI.o : integer.h fun.h pI.h


#parse.c: parse.y integer.h fun.h calc.h
#	yacc -d parse.y; mv y.tab.c parse.c

clean:
	/bin/rm *.o 

