File: Makefile

package info (click to toggle)
ocaml-benchmark 1.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 300 kB
  • sloc: ml: 1,114; makefile: 45; perl: 12
file content (37 lines) | stat: -rw-r--r-- 977 bytes parent folder | download
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
# Makefile for benchmark examples
#
# Just type "make"!

# Do not require that the package be installed to try the examples
REQUIRES 	= str unix bigarray
BENCHMARK	= -I .. benchmark.cma

EXAMPLES        = $(wildcard *.ml)
PACKAGE_OPTS    = $(if $(REQUIRES), -package "$(REQUIRES)", )
PREDICATE_OPTS  = $(if $(PREDICATES), -predicates $(PREDICATES), )
ALL_OPTS	= -annot $(PACKAGE_OPTS) $(PREDICATE_OPTS)

OCAMLC		= ocamlfind ocamlc
OCAMLOPT	= ocamlfind ocamlopt

.PHONY: all

all: byte opt native
byte: $(EXAMPLES:.ml=.exe)
opt native:  $(EXAMPLES:.ml=.com)

regexps.exe regexps.com: REQUIRES += re

%.exe: %.ml ../benchmark.cma
	$(OCAMLC) -o $@ $(ALL_OPTS) -linkpkg $(BENCHMARK) $<

%.com: %.ml ../benchmark.cmxa
	$(OCAMLOPT) -o $@ $(ALL_OPTS) -linkpkg $(BENCHMARK:.cma=.cmxa) $<

######################################################################
.PHONY: clean

clean:
	$(RM) -f $(EXAMPLES:.ml=.exe) $(EXAMPLES:.ml=.com)
	$(RM) $(wildcard *.o *.cm[iox] *~ *.annot *.dat)