File: Makefile

package info (click to toggle)
ocaml-benchmark 0.9-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze, wheezy
  • size: 236 kB
  • ctags: 222
  • sloc: ml: 689; makefile: 151; sh: 57; perl: 12
file content (37 lines) | stat: -rw-r--r-- 944 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 pcre bigarray"
BENCHMARK	= -I .. benchmark.cma

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

OCAMLC		= ocamlfind ocamlc
OCAMLOPT	= ocamlfind ocamlopt

.PHONY: all

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

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

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

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

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

clobber: clean
	rm -f $(EXAMPLES)