File: Makefile

package info (click to toggle)
ocaml-ctypes 0.24.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,180 kB
  • sloc: ml: 13,406; ansic: 3,316; makefile: 72
file content (45 lines) | stat: -rw-r--r-- 1,662 bytes parent folder | download | duplicates (5)
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
.PHONY: build bench clean

CFLAGS=-Wall -O2

CTYPES_INCLUDE=`ocamlfind query ctypes`/..

BENCH_MICRO_STUBS=bench_micro_stubs.h bench_micro_lib.c bench_micro_stubs.c
BENCH_MICRO_GENERATED=bench_micro_generated_stubs.c bench_micro_generated.ml

build: bench_micro

bench: build
	LD_LIBRARY_PATH=. ./bench_micro -ascii -q 10 +time +cycles \
		-clear-columns -no-compactions -v -ci-absolute -all-values \
		-overheads -save > summary.txt
	ocaml process_summary.ml summary.txt
	gnuplot bench_micro.gnuplot
	gnuplot bench_micro_interpreted.gnuplot

libbench_micro.so: $(BENCH_MICRO_STUBS)
	gcc -o libbench_micro.so -shared -fPIC $(CFLAGS) bench_micro_stubs.c

bench_micro_gen: $(BENCH_MICRO_STUBS) bench_micro_bindings.ml bench_micro_gen.ml
	ocamlfind opt -o bench_micro_gen \
		-linkpkg -package ctypes.foreign,ctypes.stubs \
		bench_micro_lib.c bench_micro_stubs.c \
		bench_micro_bindings.ml bench_micro_gen.ml

bench_micro_generated.ml bench_micro_generated_stubs.c: bench_micro_gen
	./bench_micro_gen

bench_micro: $(BENCH_MICRO_STUBS) $(BENCH_MICRO_GENERATED) libbench_micro.so bench_micro_bindings.ml bench_micro.ml
	ocamlfind opt -o bench_micro $(patsubst %,-ccopt %,$(CFLAGS)) \
		-cclib -lbench_micro -cclib -L. \
		-thread -linkpkg -I $(CTYPES_INCLUDE) \
		-package ctypes.foreign,ctypes.stubs,core,core_bench \
		bench_micro_lib.c bench_micro_stubs.c \
		bench_micro_generated_stubs.c \
		bench_micro_bindings.ml bench_micro_generated.ml bench_micro.ml

clean:
	rm -f bench_micro bench_micro_gen libbench_micro.so
	rm -f bench_micro_generated.ml bench_micro_generated_stubs.c
	rm -f bench_micro.eps bench_micro_interpreted.eps
	rm -f *.o *.cmo *.cmx *.cmi