| 1 |
# Makefile for benchmark examples |
| 2 |
# |
| 3 |
# Just type "make"! |
| 4 |
|
| 5 |
# Do not require that the package be installed to try the examples |
| 6 |
REQUIRES = str unix bigarray |
| 7 |
BENCHMARK = -I .. benchmark.cma |
| 8 |
|
| 9 |
EXAMPLES = $(wildcard *.ml) |
| 10 |
PACKAGE_OPTS = $(if $(REQUIRES), -package "$(REQUIRES)", ) |
| 11 |
PREDICATE_OPTS = $(if $(PREDICATES), -predicates $(PREDICATES), ) |
| 12 |
ALL_OPTS = -annot $(PACKAGE_OPTS) $(PREDICATE_OPTS) |
| 13 |
|
| 14 |
OCAMLC = ocamlfind ocamlc |
| 15 |
OCAMLOPT = ocamlfind ocamlopt |
| 16 |
|
| 17 |
.PHONY: all |
| 18 |
|
| 19 |
all: byte opt native |
| 20 |
byte: $(EXAMPLES:.ml=.exe) |
| 21 |
opt native: $(EXAMPLES:.ml=.com) |
| 22 |
|
| 23 |
regexps.exe regexps.com: REQUIRES += re |
| 24 |
|
| 25 |
%.exe: %.ml ../benchmark.cma |
| 26 |
$(OCAMLC) -o $@ $(ALL_OPTS) -linkpkg $(BENCHMARK) $< |
| 27 |
|
| 28 |
%.com: %.ml ../benchmark.cmxa |
| 29 |
$(OCAMLOPT) -o $@ $(ALL_OPTS) -linkpkg $(BENCHMARK:.cma=.cmxa) $< |
| 30 |
|
| 31 |
###################################################################### |
| 32 |
.PHONY: clean |
| 33 |
|
| 34 |
clean: |
| 35 |
$(RM) -f $(EXAMPLES:.ml=.exe) $(EXAMPLES:.ml=.com) |
| 36 |
$(RM) $(wildcard *.o *.cm[iox] *~ *.annot *.dat) |
| 37 |
|