# A simple makefile that assumes the source directory contains all
# the source files and that the makefile is being run from
# within that directory.
# Also, allegro and djgpp should be installed in the out-of-the-box way.
# The USEEXEDAT option is for appending the "allegro data" file to the executable.
# If you remove it, also remove the 
#	$(TOOLS)exedat.exe 
# line

OPTIONS = -O2 -W -Wall -DUSEEXEDAT
OBJS = triangles.o mesh.o deform.o files.o poly2tri.o misc.o monotone.o construct.o idx_list.o reduce.o
TOOLS = c:/djgpp/allegro/tools/
DATAFILE = triangles.dat

triang.exe : $(OBJS)
	gcc -s -otriang.exe $(OBJS)  -lalleg -lm
	$(TOOLS)exedat.exe triang.exe $(DATAFILE)

triangles.o : triangles.c triangles.h mesh.c tridat.h triangles.dat
mesh.o : mesh.c triangles.c triangles.h
deform.o : deform.c triangles.h
files.o : files.c triangles.h triangles.c
poly2tri.o :  poly2tri.c triangles.h triangulate.h
misc.o :  misc.c triangulate.h
monotone.o : monotone.c triangulate.h
construct.o :  construct.c triangulate.h
idx_list.o : idx_list.c idx_list.h
reduce.o : triangles.h idx_list.h idx_list.c mesh.c reduce.c

%o : %c
	gcc -c $(OPTIONS) $<
