OBJS = ast.cmo jast.cmo parser.cmo scanner.cmo jpp.cmo gpp.cmo translate.cmo graplc.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 gpp.ml jast.ml translate.ml graplc.ml \
	$(TESTS:%=tests/test-%.mc) \
	$(TESTS:%=tests/test-%.out)

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

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

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

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

# Generated by ocamldep *.ml *.mli
ast.cmo:
ast.cmx:
translate.cmo: jast.cmo gpp.cmo ast.cmo
translate.cmx: jast.cmx gpp.cmx ast.cmx
gpp.cmo: ast.cmo
gpp.cmx: ast.cmx
graplc.cmo: scanner.cmo parser.cmi jpp.cmo gpp.cmo translate.cmo
graplc.cmx: scanner.cmx parser.cmx jpp.cmx gpp.cmx translate.cmx
jast.cmo:
jast.cmx:
jpp.cmo: jast.cmo
jpp.cmx: jast.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





