Source

ocaml-lib / monad / makefile

Full commit
OCAMLC=ocamlc
INCLUDES= -I ..               # all relevant -I options here
OCAMLFLAGS= $(INCLUDES)   # add other options for ocamlc here
OCAMLDOCFLAGS= -d doc $(INCLUDES)

# The list of object files
OBJ = sumonad.cmo

all: sumonad.cma pa_sumonad.cmo
	echo

sumonad.cma: $(OBJ)
	ocamlc $(OCAMLFLAGS) -a -o sumonad.cma $(OBJ)
	ocamlopt $(OCAMLFLAGS) -a -o sumonad.cmxa $(OBJ:.cmo=.cmx)

pa_sumonad.cmo: pa_sumonad.ml
	ocamlc -I +camlp4 camlp4lib.cma -pp camlp4orf -c pa_sumonad.ml

essai.exe: essai.ml
	ocamlc -o essai.exe -pp "camlp4o -I . pa_sumonad.cmo" str.cma sumonad.cma essai.ml

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

%.cmo: %.ml
	ocamlc $(OCAMLFLAGS) -c $<
	ocamlopt $(OCAMLFLAGS) -c $<

%.exe: %.ml
	ocamlc -o $@ -pp "camlp4o -I . pa_sumonad.cmo" str.cma sumonad.cma $<

# Documentationg
html:
	ocamldoc $(OCAMLDOCFLAGS) -html $(ALL:.cmo=.ml)

# Clean up
clean:
	rm -f *.cm[ioax]
	rm -f *.cmxa
	rm -f *.[oa]