#For those machine doesn't have ocamlbuild, build the project with this makefile
#	
OBJ=ast.cmo \
	scanner.cmo \
	parser.cmo \
	parser_test.cmo \
	sast.cmo \
	semantic.cmo \
	type_reader.cmo \
	print_typetab.cmo \
	generate.cmo \
	generate_test.cmo \
	typereader_test.cmo  \
	semantic_test.cmo

YO=semantic_test

FLAGS:=-g

$(YO): $(OBJ)
	ocamlc -g -o parser_test parser.cmo scanner.cmo ast.cmo parser_test.cmo 
	ocamlc -g -o typereader_test parser.cmo scanner.cmo ast.cmo sast.cmo type_reader.cmo print_typetab.cmo typereader_test.cmo
	ocamlc -g -o generate_test parser.cmo scanner.cmo ast.cmo sast.cmo semantic.cmo type_reader.cmo print_typetab.cmo generate.cmo generate_test.cmo 
	ocamlc -g -o semantic_test parser.cmo scanner.cmo ast.cmo sast.cmo semantic.cmo type_reader.cmo print_typetab.cmo semantic_test.cmo

.SUFFIXES: .ml .cmo .cmi .mll .mly .mli
.PRECIOUS: %.ml %.mli %.cmo

.ml.cmo:
	ocamlc -c $(FLAGS) $<

.mli.cmi:
	ocamlc -c $(FLAGS) $<
    
.mll.ml:
	ocamllex $<

.mly.ml:
	ocamlyacc -v $<

.mly.mli:
	ocamlyacc -v $<

clean:
	rm -f *.cmi *.cmo parser.ml scanner.ml *.output parser.mli parser_test semantic_test generate_test 

# Generated by ocamldep
ast.cmo:
ast.cmx:
parser.cmo: ast.cmo parser.cmi
parser.cmx: ast.cmx parser.cmi
parser.cmi: ast.cmo
scanner.cmo: parser.cmi
scanner.cmx: parser.cmx
parser_test.cmo: scanner.cmo parser.cmi ast.cmo
parser_test.cmx: scanner.cmx parser.cmx ast.cmx
sast.cmo: ast.cmo
sast.cmx: ast.cmx
semantic.cmo: sast.cmo ast.cmo
semantic.cmx: sast.cmx ast.cmx
type_reader.cmo: ast.cmo
type_reader.cmx: ast.cmx
print_typetab.cmo: ast.cmo
print_typetab.cmx: ast.cmx
generate.cmo: sast.cmo ast.cmo
generate.cmx: sast.cmx ast.cmx
generate_test.cmo: type_reader.cmo semantic.cmo scanner.cmo parser.cmi generate.cmo ast.cmo
generate_test.cmx: type_reader.cmx semantic.cmx scanner.cmx parser.cmx generate.cmx ast.cmx
typereader_test.cmo: type_reader.cmo scanner.cmo print_typetab.cmo parser.cmi ast.cmo
typereader_test.cmx: type_reader.cmx scanner.cmx print_typetab.cmx parser.cmx ast.cmx
semantic_test.cmo: type_reader.cmo semantic.cmo scanner.cmo sast.cmo parser.cmi ast.cmo
semantic_test.cmx: type_reader.cmx semantic.cmx scanner.cmx sast.cmx parser.cmx ast.cmx
