Source

ocaml-lib / ipp / makefile

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

# The list of object files
OBJ = ipp.cmo printer.cmo

all: ipp.cma pa_ipp.cmo
	echo

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

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

essai.exe: essai.ml
	ocamlc -o essai.exe -pp "camlp4o -I . pa_ipp.cmo" ipp.cma essai.ml

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

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

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

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