.PHONY: all clean

PKG = -package oUnit,nkf

all: test.run test.opt

test.run: test.cmo
	ocamlfind ocamlc -linkpkg $(PKG) -o $@ nkf.cma $<

test.opt: test.cmx
	ocamlfind ocamlopt -linkpkg $(PKG) -o $@ nkf.cmxa $<

test.cmo: test.ml test.cmi
	ocamlfind ocamlc -c $(PKG) $<

test.cmx: test.ml test.cmi
	ocamlfind ocamlopt -c $(PKG) $<

test.cmi: test.mli
	ocamlfind ocamlc -c $(PKG) $<

test.mli: test.ml
	ocamlfind ocamlc -i $(PKG) $< > $@

clean:
	rm -f *.mli *.cm[iox] *.o test.run test.opt
