OBJS = ast.cmo utility.cmo class.cmo environment.cmo lists.cmo parser.cmo scanner.cmo ncgenerator.cmo sast.cmo geocode.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 ncgenerator.ml sast.ml geocode.ml \
	$(TESTS:%=tests/test-%.mc) \
	$(TESTS:%=tests/test-%.out)

geocode : $(OBJS)
	ocamlc -o geocode $(OBJS)

.PHONY : test
test : geocode 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 $<

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

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

# Generated by ocamldep *.ml *.mli
ast.cmo :
ast.cmx :
class.cmo : utility.cmo ast.cmo
class.cmx : utility.cmx ast.cmx
environment.cmo : utility.cmo class.cmo ast.cmo
environment.cmx : utility.cmx class.cmx ast.cmx
geocode.cmo : utility.cmo scanner.cmo sast.cmo parser.cmi ncgenerator.cmo \
    ast.cmo
geocode.cmx : utility.cmx scanner.cmx sast.cmx parser.cmx ncgenerator.cmx \
    ast.cmx
lists.cmo : utility.cmo environment.cmo ast.cmo
lists.cmx : utility.cmx environment.cmx ast.cmx
ncgenerator.cmo : utility.cmo lists.cmo environment.cmo class.cmo ast.cmo
ncgenerator.cmx : utility.cmx lists.cmx environment.cmx class.cmx ast.cmx
parser.cmo : utility.cmo ast.cmo parser.cmi
parser.cmx : utility.cmx ast.cmx parser.cmi
sast.cmo : utility.cmo lists.cmo environment.cmo class.cmo ast.cmo
sast.cmx : utility.cmx lists.cmx environment.cmx class.cmx ast.cmx
scanner.cmo : utility.cmo parser.cmi
scanner.cmx : utility.cmx parser.cmx
utility.cmo : ast.cmo
utility.cmx : ast.cmx
parser.cmi : ast.cmo
