Source

ocaml-llists / Makefile

ALL := lazy_list.cmo lazy_list.cmx pa_llistcomp.cma

CAMLP4DIR := $(shell camlp4 -where)
LIBDIR    := $(shell dirname `camlp4 -where`)

.PHONY: all doc tests runtests clean


all: $(ALL) doc


lazy_list.cmo: lazy_list.ml lazy_list.cmi
	ocamlc -c -pp camlp4o $<
lazy_list.cmx: lazy_list.ml lazy_list.cmi
	ocamlopt -c -pp camlp4o $<
lazy_list.cmi: lazy_list.mli
	ocamlc -c $<

pa_llistcomp.cma: traverse.cmo patterns.cmo pa_llistcomp.cmo
	ocamlc -I +camlp4 -a $^ -o $@

pa_llistcomp.cmo: pa_llistcomp.ml patterns.cmo
	ocamlc -I +camlp4 -pp camlp4orf -I . traverse.cmo patterns.cmo -c $<

patterns.cmo: patterns.ml traverse.cmo
	ocamlc -I +camlp4 -pp "camlp4of -loc loc" -c $<

traverse.cmo: traverse.ml traverse.cmi
	ocamlc -I +camlp4 -c $<
traverse.cmi: traverse.mli
	ocamlc -I +camlp4 -c $<


doc:
	mkdir -p doc
	ocamldoc -html -d doc lazy_list.mli


tests:
	@make -C tests

runtests: all tests
	@make -C tests runtests


install:
	install -m 0644 lazy_list.cm[iox] $(LIBDIR)
	install -m 0644 pa_llistcomp.cma $(CAMLP4DIR)

uninstall:
	rm -f $(addprefix $(LIBDIR)/, lazy_list.cm[iox])
	rm -f $(addprefix $(CAMLP4DIR)/, pa_llistcomp.cma)


clean:
	rm -Rf *~ \#* *.cm[iox] *.o $(ALL)
	rm -Rf doc
	@make -C tests clean