#
# Makefile for lyapunov
#
# Copyright 1991, Garrett A. Wollman.  This program may be
# modified and distributed for any purpose and without fee,
# provided that this notice is included verbatim on all such
# copies.  Binary distributions without this source file are
# prohibited.  All modified versions must be labeled prominently
# with the name of the modifier and the date of modification.
#

PROGRAM =       lyapunov
CFILES  =       lyapunov.c

#
# for SGI, use cc -O3 -mp
# for most others, probably use gcc -O2
# 
CC      =       cc
CDEBUGFLAGS=    -O3
CFLAGS  =       -mp $(CDEBUGFLAGS)

# for Sun-4/4.1 with gcc
#CC    =       gcc
#CDEBUGFLAGS=  -O -fstrength-reduce -finline-functions -fcombine-regs
#CFLAGS        =       $(CDEBUGFLAGS) -Wall -DSUN_BROKEN_STDLIB

LFLAGS  =       -lm

# change these as appropriate when doing a 'make benchmark'
PROCESSORS=
BENCHOUT=       /dev/null
SENDMAIL=       /usr/lib/sendmail -oi -t
MACHINE =       SGI 4D/480S

$(PROGRAM):    $(CFILES)
       $(CC) $(CFLAGS) -o $(PROGRAM) $(CFILES) $(LFLAGS)

benchmark:      $(PROGRAM)
       time $(PROGRAM) -r 1280 -c 1024 $(PROCESSORS) -o $(BENCHOUT) \
            -5 3 4 3 4 bbbbbbaaaaaa 2>bench.timing
       @echo "To: wollman@emily.uvm.edu, `logname`" >bench.hdr
       @echo "Subject: lyapunov benchmark results" >>bench.hdr
       @echo "" >>bench.hdr
       @echo "On" $(PROCESSORS) "of `hostname` (a" $(MACHINE) "):" >>bench.hdr
       cat bench.hdr bench.timing | $(SENDMAIL)
       rm -f bench.hdr bench.timing

clean:
       rm -f $(PROGRAM) bench.hdr bench.timing core *~ #*# *.BAK
       rm -f *.CKP
