OBJS = ast.cmo parser.cmo scanner.cmo compile.cmo warmfusion.cmo

TESTS = \
arith1 \
arith2 \
fib \
for1 \
func1 \
func2 \
func3 \
gcd \
global1 \
hello \
if1 \
if2 \
if3 \
if4 \
ops1 \
var1 \
while1

TARFILES = Makefile testall.sh scanner.mll parser.mly \
	ast.ml compile.ml warmfusion.ml \
	$(TESTS:%=tests/test-%.mc) \
	$(TESTS:%=tests/test-%.out)

warmfusion : $(OBJS)
	ocamlc -o warmfusion str.cma $(OBJS)

.PHONY : test
test : warmfusion testall.sh
	./testall.sh

scanner.ml : scanner.mll
	ocamllex scanner.mll

parser.ml parser.mli : parser.mly
	ocamlyacc parser.mly

%.cmo : %.ml
	ocamlc -c $<

%.cmi : %.mli
	ocamlc -c $<

warmfusion.tar.gz : $(TARFILES)
	cd .. && tar czf warmfusion/warmfusion.tar.gz $(TARFILES:%=warmfusion/%)

.PHONY : clean
clean :
	rm -f warmfusion parser.ml parser.mli scanner.ml testall.log \
	*.cmo *.cmi *.out *.diff

# Generated by ocamldep *.ml *.mli
ast.cmo: 
ast.cmx:  
compile.cmo: ast.cmo 
compile.cmx: ast.cmx 
warmfusion.cmo: scanner.cmo parser.cmi compile.cmo ast.cmo 
warmfusion.cmx: scanner.cmx parser.cmx compile.cmx ast.cmx 
parser.cmo: ast.cmo parser.cmi 
parser.cmx: ast.cmx parser.cmi 
scanner.cmo: parser.cmi 
scanner.cmx: parser.cmx 
parser.cmi: ast.cmo 
