Merge branch 'minimum-excludant-other-versions' into 'master'
[why3.git] / examples / split_string / Makefile
blobfcc6d2d249c144d27867e88b9ed7065dfe03846a
2 BENCH ?= no
4 ifeq ($(BENCH),yes)
5 WHY3=../../bin/why3.opt
6 WHY3SHARE=../../share
7 else
8 ifeq ($(BINDIR),)
9 WHY3=why3
10 else
11 WHY3=$(BINDIR)/why3
12 endif
13 WHY3SHARE=$(shell $(WHY3) --print-datadir)
14 endif
16 include $(WHY3SHARE)/Makefile.config
18 ifeq ($(BENCH),yes)
19 INCLUDE += -I ../../lib/why3
20 endif
22 MAIN=main
23 OBJ=split_string
25 ML = $(addsuffix .ml, $(OBJ))
26 CMO = $(addsuffix .cmo, $(OBJ))
27 CMX = $(addsuffix .cmx, $(OBJ))
29 OCAMLOPT=ocamlopt -noassert -inline 1000
31 all: $(MAIN).$(OCAMLBEST)
33 extract: $(ML)
35 doc:
36 $(WHY3) doc ../split_string.mlw
37 $(WHY3) session html .
39 $(MAIN).byte: $(CMO) $(MAIN).cmo
40 ocamlc $(INCLUDE) zarith.cma -o $@ $^
42 $(MAIN).opt: $(CMX) $(MAIN).cmx
43 $(OCAMLOPT) $(INCLUDE) zarith.cmxa -o $@ $^
45 $(MAIN).cmx: $(CMX)
47 $(ML): ../split_string.mlw
48 $(WHY3) extract -D ocaml64 -L . -L .. -D split_string.drv -o $@ split_string.SplitStringOCaml
50 %.cmx: %.ml
51 $(OCAMLOPT) $(INCLUDE) -annot -c $<
53 %.cmo: %.ml
54 ocamlc $(INCLUDE) -annot -c $<
56 %.cmi: %.mli
57 ocamlc $(INCLUDE) -annot -c $<
59 clean::
60 rm -f $(ML) *.cm[xio] *.o *.annot $(MAIN).opt $(MAIN).byte