# Remove -Bstatic on non-Sun systems
# Use -systype bsd43 on MIPS systems
CFLAGS = -O -Bstatic

R_OBJECTS= Zmod.o calc.o cr.o exp.o fusion.o interval.o prime_test.o \
	   rat.o window.o xlong.o

OBJECTS= $(R_OBJECTS) curses.o term.o to_hex.o runtime/rrt0.o

all: test calc

test: runtime_test.o runtime/rrt0.o
	$(CC) -o test $(CFLAGS) runtime_test.o runtime/rrt0.o
	./test

# On an RS/6000, remove the -ltermlib
calc: $(OBJECTS)
	$(CC) -o calc $(CFLAGS) $(OBJECTS) -lcurses -ltermlib -lm

runtime/rrt0.o:
	cd runtime; make
