# "make test" Compiles everything and runs the regression tests

.PHONY : test
test : all testall.sh
	./testall.sh

# "make all" builds the executable

.PHONY : all
all : mathlight.native matrices.o

# Testing the "printbig" example

matrices : matrices.c
	cc -o matrices -DBUILD_TEST matrices.c


# "make mathlight.native" compiles the compiler
#
# The _tags file controls the operation of ocamlbuild, e.g., by including
# packages, enabling warnings
#
# See https://github.com/ocaml/ocamlbuild/blob/master/manual/manual.adoc

mathlight.native :
	opam config exec -- \
	ocamlbuild -use-ocamlfind mathlight.native

# "make clean" removes all generated files

.PHONY : clean
clean :
	ocamlbuild -clean
	rm -rf testall.log ocamlllvm *.diff
