1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
|
# Write here all the findlib packages you need, for example:
PACKAGES= lwt.unix,ocsigen
# Write here all your .ml files, in dependency order (default: all)
FILES=$(wildcard *.ml)
CAMLC = ocamlfind ocamlc -g $(LIB)
CAMLOPT = ocamlfind ocamlopt $(LIB)
CAMLDOC = ocamlfind ocamldoc $(LIB)
CAMLDEP = ocamlfind ocamldep
#OCSIGENREP = `ocamlfind query ocsigen`
#OCSIGENREP = ../ocsigen/lib
LIB = -package $(PACKAGES)
# If you use the syntax extension:
# PP = -pp "camlp4o $(OCSIGENREP)/xhtmlsyntax.cma"
# otherwise:
PP =
OBJS = $(FILES:.ml=.cmo)
CMA = site.cma
all: $(CMA)
$(CMA): $(OBJS)
$(CAMLC) -a -o $(CMA) $(OBJS)
.SUFFIXES:
.SUFFIXES: .ml .mli .cmo .cmi .cmx
.PHONY: doc
.ml.cmo:
$(CAMLC) $(PP) -c $<
.mli.cmi:
$(CAMLC) -c $<
.ml.cmx:
$(CAMLOPT) $(PP) -c $<
doc:
# $(CAMLDOC) -d doc -html foo.mli
clean:
-rm -f *.cm[ioxa] *~ $(NAME)
depend:
$(CAMLDEP) $(PP) $(LIB) $(FILES:.ml=.mli) $(FILES) > .depend
FORCE:
include .depend
|