# generic OCaml makefile; from ocamldep docs
OCAMLC=ocamlc
OCAMLOPT=ocamlopt
OCAMLDEP=ocamldep
INCLUDES=                 # all relevant -I options here
OCAMLFLAGS=$(INCLUDES)    # add other options for ocamlc here
OCAMLOPTFLAGS=$(INCLUDES) # add other options for ocamlopt here

# The object files required (.cmo or .cmx)
OBJS=select.cmx kernel.cmx knn.cmx knntest.cmx

# specify the name of the program here
knntest: $(OBJS)
	$(OCAMLOPT) -o knntest $(OCAMLFLAGS) $(OBJS)

# Nothing below should require changing.

# Common rules
.SUFFIXES: .ml .mli .cmo .cmi .cmx

.ml.cmo:
	$(OCAMLC) $(OCAMLFLAGS) -c $<

.mli.cmi:
	$(OCAMLC) $(OCAMLFLAGS) -c $<

.ml.cmx:
	$(OCAMLOPT) $(OCAMLOPTFLAGS) -c $<

# Clean up
clean:
	rm -f knntest
	rm -f *.cm[iox] *.o

# Dependencies
depend:
	$(OCAMLDEP) $(INCLUDES) *.mli *.ml > .depend

include .depend

