# Set some variables at the beginning
OCAMLC=ocamlc
PACKAGE_ARGS=-package oUnit

# To build tests, we need compiled object files.
tests: higherOrderFunctions.cmo tests.cmo
	ocamlfind $(OCAMLC) -linkpkg $(PACKAGE_ARGS) -o tests $^

# To build an object file, we need the original source code.
%.cmo: %.ml
	ocamlfind $(OCAMLC) $(PACKAGE_ARGS) -c $^

# Here's how we clean things up
.PHONY: clean
clean:
	rm -f *.cmo
	rm -f *.cmi
	rm -f tests
