# This makefile uses Otter object code in the parent directory.
# The Otter code should be compiled before using this makefile.

DFLAGS = -DTP_NAMES -DTP_SIGNAL -DTP_FORK -DTP_RUSAGE

CC = gcc

#############################################################################
# Specify the compiler flags; include DFLAGS (above) and SCT (SCOTT)
#
# optimized

CFLAGS = -O $(DFLAGS) $(SCT)

#
# save symbols for debuggers
# CFLAGS = -g $(DFLAGS) $(SCT)
#
# optimized, debugging  (gcc and gdb can handle this)
# CFLAGS = -O -g $(DFLAGS) $(SCT)
#
# gprof profiling
# CFLAGS = -pg -O $(DFLAGS) $(SCT)

#############################################################################

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 ../foreign.o ../geometry.o ../hot.o ../nonport.o ../dp_util.o ../check.o ../hints.o ../attrib.o ../case.o ../prune.o ../lisp.o ../ivy.o

#############################################################################
#
#  The following is for FormEd, a program for displaying and
#  editing formulas.
#

# XLIBS = -lXaw -lXmu -lXext -lXt -lX11 -lm

# We used to need the following at MCS; you may need something similar.
# XLIBS = -L/usr/local/X11R5/lib -lXaw -lXmu -lXext -lXt -lX11 -lm
# CFLAGS = -O $(DFLAGS) $(SCT) -I/usr/include/X11

# I need the following on my Linux computer:

XLIBS = -L/usr/X11R6/lib -lXaw -lXmu -lXext -lXt -lX11 -lm

# At MCS, I have to use -static

formed: formed.o display.o callback.o $(OBJECTS)
	$(CC) $(CFLAGS) formed.o display.o callback.o $(OBJECTS) $(XLIBS) -o formed

formed.o $(OBJECTS): ../header.h
formed.o $(OBJECTS): ../types.h
formed.o $(OBJECTS): ../macros.h
formed.o $(OBJECTS): ../cos.h
formed.o $(OBJECTS): ../proto.h
foreign.o: ../foreign.h

display.o callback.o formed.o: formed.h
