#
#  UNIX makefile for building Otter.
#
#  DFLAGS controls conditional compilation:
#    -DTP_UNIX specifies basic UNIX compliation.
#    -DTP_SUN does something cute, but it seems to work only on Suns.
#    -DTP_NO_STDLIB is necessary on some UNIXes, because stdlib.h is absent.
#    (-DTURBO_C is for PC.)
#    (-DTHINK_C is for Macintosh.)
#    (-DROO is for ROO, the shared-memory parallel version.)

DFLAGS = -DTP_UNIX

#GNU C compiler: gcc generates faster code on Sun3, cc better on Sun4.
#CC = gcc

# optimized
CFLAGS = -O $(DFLAGS)

# save symbols for dbx
#CFLAGS = -g $(DFLAGS)

# gprof profiling
#CFLAGS = -pg -O $(DFLAGS)

FILES =   av.c io.c share.c fpa.c clocks.c unify.c demod.c weight.c imd.c is.c clause.c options.c resolve.c index.c paramod.c formula.c process.c misc.c lrpo.c linkur.c linkhyp.c

OBJECTS = av.o io.o share.o fpa.o clocks.o unify.o demod.o weight.o imd.o is.o clause.o options.o resolve.o index.o paramod.o formula.o process.o misc.o lrpo.o linkur.o linkhyp.o

otter: main.o $(OBJECTS)
	$(CC) $(CFLAGS) main.o $(OBJECTS) $(LIBRARIES) -o otter
	size otter

lint:
	lint $(DFLAGS) main.c $(FILES)

proto:
	csh make_proto main.c $(FILES)

clean:
	/bin/rm *.o

main.o $(OBJECTS): header.h
main.o $(OBJECTS): types.h
main.o $(OBJECTS): macros.h
# main.o $(OBJECTS): cos.h
# main.o $(OBJECTS): proto.h
