#
# Makefile for flib2c and TW Graph example programs in C
#            12/7/93  (C) Joerg Schoen
#

#  Flags for Silicon Graphics machines (V5.2)
CFLAGS = -O2 -I.
FORTFLAGS = -lftn -lm
TWGFLAGS  = -ltwg -ltwgpost $(FORTFLAGS)
IMSLFLAGS = -limsl $(FORTFLAGS)

#  The same for AIX/RS6000.
#CFLAGS= -O3 -qansialias -I.
#FORTFLAGS = -lxlf -lm
#TWGFLAGS  = -ltwg -ltwgpost $(FORTFLAGS)
#IMSLFLAGS = -limslib $(FORTFLAGS)

#   Make example programs
test: twgtest

twgtest: twgtest.c twgraph.h
	$(CC) twgtest.c $(TWGFLAGS) $(CFLAGS) -o $@

#   Rule for making "twgraph.h" from "twgraph.def"
twgraph.h: twgraph.def flib2c
	flib2c twgraph.def twgraph.h

#   Rule for IMSL (Underscore is independent of machine)
imsl.h: imsl.def
	flib2c -p_ imsl.def imsl.h

#   How to make "flib2c"
flib2c: flib2c.c
	$(CC) $(CFLAGS) -o $@ flib2c.c
