OCC=ocamlopt.opt
EXEC=transformer
all: lexer.cmx general.cmx parser.cmx qbf_10.cmx qbf.cmx main.cmx
	$(OCC) -o $(EXEC) general.cmx lexer.cmx parser.cmx qbf_10.cmx qbf.cmx main.cmx

lexer.cmx: lexer.ml
	$(OCC) -c lexer.ml
parser.cmi: parser.mli qbf.cmx
	$(OCC) -c parser.mli
parser.cmx: parser.ml parser.cmi
	$(OCC) -c parser.ml
main.cmx: main.ml
	$(OCC) -c main.ml

lexer.ml: lexer.mll parser.cmx
	ocamllex lexer.mll

parser.ml: parser.mly
	ocamlyacc parser.mly

qbf.cmx: qbf_10.cmx qbf.ml
	$(OCC) -c qbf.ml

qbf_10.cmx: general.cmi qbf_10.ml
	$(OCC) -c qbf_10.ml

general.cmi: general.mli
	$(OCC) -c general.mli

general.cmx: general.ml
	$(OCC) -c general.ml

clean:
	-rm -rf parser.ml parser.mli lexer.ml
	-rm -rf *.cmx *.cmi 
	-rm -rf *.obj *.o $(EXEC) 
	-rm -rf *~
