#!/bin/bash
ocamllex preprocessor.mll
ocamlc -o preprocessor str.cma preprocessor.ml
ocamlc -c message.ml # compile error message reporter
ocamllex scanner.mll # create scanner.ml
ocamlyacc parser.mly # create parser.ml and parser.mli
ocamlc -c ast.ml # compile AST types
ocamlc -c parser.mli # compile parser types
ocamlc -c scanner.ml # compile the scanner
ocamlc -c parser.ml # compile the parser
ocamlc -c str.cma generator.ml # compile the generator
ocamlc -c finaltest.ml # compile the tester
ocamlc -c type_infer.ml # compile type inference checker
ocamlc -c executor.ml # compile the executor
ocamlc -o tests unix.cma str.cma generator.cmo message.cmo scanner.cmo ast.cmo parser.cmo type_infer.cmo finaltest.cmo  # generate test runner
ocamlc -o geb unix.cma str.cma generator.cmo message.cmo scanner.cmo ast.cmo parser.cmo type_infer.cmo executor.cmo # generate Godel, Escher, Bach Compiler 
