OBJS = ast.cmo parser.cmo scanner.cmo main.cmo

ast-pp : $(OBJS)
	ocamlc -o ast-pp $(OBJS)

# bizzarre, probably macroifyable, just a prototype

ast.ml : ../ast.ml
	cat ../ast.ml > ast.ml

main.ml : ../main.ml
	cat ../main.ml > main.ml

parser.mly : ../parser.mly
	cat ../parser.mly > parser.mly
	
scanner.mll : ../scanner.mll
	cat ../scanner.mll > scanner.mll

# now the normal stuff

scanner.ml : scanner.mll
	ocamllex scanner.mll

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

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

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

.PHONY : clean
clean :
	rm -f *.* ast-pp
	make -C ../tests/example/build clean
	make -C ../tests/microc clean

.PHONY : test
test : ast-pp
	make -C ../tests/example/build
	make -C ../tests/microc

# Generated by ocamldep *.ml *.mli
ast.cmo: 
ast.cmx: 
bytecode.cmo: ast.cmo 
bytecode.cmx: ast.cmx 
compile.cmo: bytecode.cmo ast.cmo 
compile.cmx: bytecode.cmx ast.cmx 
execute.cmo: bytecode.cmo ast.cmo 
execute.cmx: bytecode.cmx ast.cmx 
interpret.cmo: ast.cmo 
interpret.cmx: ast.cmx 
main.cmo: scanner.cmo parser.cmi ast.cmo 
main.cmx: scanner.cmx parser.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 
