# Makefile for compiling the PANOPTES

# Requisites:
#	camlimages 
#	lablgl
#	lablgtk2
#	lablglarea2
#	lablglut
#	ImageMagick
#	latex
#	graphviz  (for the dot-layouter)

CC = ocamlc

MLFLAGS = -cclib -custom unix.cma -I +lablGL -pp "camlp4o"

LIBS = lablglut.cma lablgl.cma str.cma

FLAGS_GENERATOR = -I +lablGL -I +camlimages

LIBS_GENERATOR = ci_core.cma graphics.cma ci_graphics.cma \
	oImages.cmo ci_jpeg.cma ci_ppm.cma images.cmo 

SRC = sqn_grabber.ml types.ml textGL.ml parser.ml node.ml arrow.ml parser_dot.ml canvas.ml

OTHER = -w s

all:
	$(CC) $(MLFLAGS) $(OTHER) $(LIBS) $(SRC) panoptes.ml -o panoptes -cclib -lobjc

doc:
	ocamldoc -latex -o ocamldoc.out.tex -latextitle 1,section -noheader -notoc -notrailer -I +lablGL -pp "camlp4o" $(SRC) panoptes.ml 

clean:
	rm -rf *.cmo *.cmi *.mod *~ *.aux *.dvi *.ps *.tex *.log imps_dg.dot .depend

dot:
	ocamldep -pp "camlp4o" *.ml | ocamldot -fullgraph | dot -Tjpg > panoptes.jpg

generator:
	$(CC) $(FLAGS_GENERATOR) $(OTHER) $(LIBS) $(LIBS_GENERATOR) font_generator.ml -o generator

