# Makefile for Surface Evolver

# Remove #'s from following 3 lines for generic Unix without graphics
#CFLAGS= -DGENERIC
#GRAPH= nulgraph.o 
#GRAPHLIB= 

# Remove #'s from the following three lines for Suns with cheyenne graphics.
# Modify paths as necessary.
#CFLAGS = -DSUN  -I/u/graphics/include
#GRAPH= cheygraph.o
#GRAPHLIB= /u/graphics/lib/sun3/cheyenne.a

# Remove #'s from the following three lines for Sparcstations with 
# cheyenne graphics.  Modify paths as necessary.  
#CFLAGS =  -DSUN  -I/u/graphics/include
#GRAPH= cheygraph.o
#GRAPHLIB= /u/graphics/lib/sun4/cheyenne.a

# Remove #'s from the following three lines for Iris workstations.
#CFLAGS = -DIRIS 
#GRAPH= iriszgraph.o
#GRAPHLIB=  -lgl_s 

# Remove #'s from the following three lines for Iris workstations with OOGL
#CFLAGS = -DIRIS -DOOGL -I/u/gcg/grap/include
#GRAPH= iriszgraph.o
#GRAPHLIB=  -lgl_s -L/u/gcg/grap/lib/sgi -lgeom -lstubdraw -lquad -lgeom -lbbox -l3d -lstub -lc_s

# Remove #'s from the following three lines for Xenix 386 with CGI graphics.
#CFLAGS = -DXENIX386 
#GRAPH= cgigraph.o
#GRAPHLIB= -lccgi 

# Remove #'s from following 3 lines for XENIX 286 without graphics
#CFLAGS= -Ml -LARGE -DGENERIC
#GRAPH= nulgraph.o 
#GRAPHLIB= 

# Remove #'s from following 3 lines for NeXT without screen graphics
#CFLAGS= -DNeXT
#GRAPH= nulgraph.o 
#GRAPHLIB= 

# Remove #'s from the following three lines for HP 98731 workstations.
#CFLAGS = -DHP
#GRAPH= hpzgraph.o
#GRAPHLIB=  -ldd98731 -lsb1 -lsb2

OBJ= calcforc.o  variable.o trirevis.o  stringl.o stringq.o model.o\
	 fixvol.o query.o matrix.o grapher.o painter.o filml.o filmq.o\
	 torvol.o lexinit.o graphgen.o modify.o userio.o boundary.o\
         curtest.o display.o yexparse.o lexyy.o ytab.o gladjust.o\
	 express.o cnstrnt.o verpopst.o popfilm.o machine.o veravg.o \
	 pixgraph.o tmain.o  tordup.o wulff.o help.o psgraph.o check.o  \
	 utility.o skeleton.o  storage.o dump.o iterate.o filgraph.o zoom.o\
         softimag.o mvgraph.o lowbound.o diffuse.o sqcurve.o\
	 command.o hidim.o simplex.o metric.o torus.o quotient.o alice.o\
	 sdrv.o odrv.o userfunc.o kusner.o


# Set any compiler options you need (floating point, optimization,  etc.)

evolver: makemark  $(OBJ)  $(GRAPH)
	cc $(CFLAGS)  $(OBJ) $(GRAPH) $(GRAPHLIB) -o evolver -lm   

# This is to get global dependencies on the main header files.
makemark: skeleton.h storage.h model.h
	cd . >o.o
	rm *.o
	touch makemark

.c.o:
	cc $(CFLAGS) -c  $<
 

lexyy.c: datafile.lex express.h ytab.c lex.h
	lex datafile.lex
	cp lex.yy.c lexyy.c
	rm lex.yy.c

ytab.c:  express.yac  express.h
	yacc -d express.yac
	cp y.tab.c ytab.c
	cp y.tab.h ytab.h
	rm y.tab.c y.tab.h

ytab.h: ytab.c 

lexinit.o: lex.h lexinit.c express.h ytab.h

query.o: lex.h ytab.h query.c

express.o: express.c lex.h ytab.h express.h

yexparse.o: yexparse.c lex.h ytab.h express.h

tmain.o: tmain.c include.h


