#=======================================================================
# Makefile for Elefunt tests
# [17-Mar-1993]
#=======================================================================

CFLAGS		= $(COPT) $(XCFLAGS)

COBJS		= infnan.o

COPT		= -g

# list of library functions missing in double precision
MISSINGDPOBJ	= dcotan.o

# list of library functions missing in quadruple precision
MISSINGQPOBJ	= qcotan.o

FFLAGS		= $(OPT) $(XFFLAGS)

LST		= lst

LDFLAGS		=

LIBS		=

NAME		= xxx

OPT		= -g

OUT		= $(LST)-$(NAME)

RM		= /bin/rm -f

SHELL		= /bin/sh

XFFLAGS		=

#=======================================================================
.PRECIOUS:	talldp tallqp tallsp

.SUFFIXES:
.SUFFIXES: .o .s .f .c

.f.o:
	$(FC) -c $(FFLAGS) -o $*.o $*.f

.f.s:
	$(FC) -S $(FFLAGS) $*.f

#=======================================================================

all:	talldp tallsp

# Only a few Fortran implementations offer 128-bit quadruple precision
# arithmetic, so we cannot make tallqp a default target:

all3:	talldp tallqp tallsp

clean:
	-$(RM) *~
	-$(RM) talldp.o tallqp.o tallsp.o $(MISSINGDPOBJ) $(MISSINGQPOBJ) $(COBJS)
	-$(RM) \#*
	-$(RM) a.out
	-$(RM) core

clobber:	distclean

distclean:	mostlyclean
	-$(RM) talldp.$(OUT) tallqp.$(OUT) tallsp.$(OUT)
	-$(RM) talldp tallqp tallsp

mostlyclean:	clean
	-$(RM) talldp.s tallqp.s tallsp.s

talldp: talldp.o $(MISSINGDPOBJ) $(COBJS)
	$(FC) $(FFLAGS) -o $@ talldp.o $(MISSINGDPOBJ) $(COBJS) $(LDFLAGS) $(LIBS)
	-./$@ >talldp.$(OUT) 2>&1

tallqp: tallqp.o $(MISSINGQPOBJ) $(COBJS)
	$(FC) $(FFLAGS) -o $@ tallqp.o $(MISSINGQPOBJ) $(COBJS) $(LDFLAGS) $(LIBS)
	-./$@ >tallqp.$(OUT) 2>&1

tallsp: tallsp.o $(COBJS)
	$(FC) $(FFLAGS) -o $@ tallsp.o $(COBJS) $(LDFLAGS) $(LIBS)
	-./$@ >tallsp.$(OUT) 2>&1
