forked from xavierleroy/pringo
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
113 lines (83 loc) · 2.49 KB
/
Makefile
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
OCAMLFLAGS=-g -safe-string -bin-annot
OCAMLC=ocamlc $(OCAMLFLAGS)
OCAMLOPT=ocamlopt $(OCAMLFLAGS)
OCAMLDEP=ocamldep
OCAMLMKLIB=ocamlmklib
OCAMLFIND=ocamlfind
DIEHARDER=dieharder -g 200 -a
ENT=head -c 1000000 | ent
include $(shell $(OCAMLC) -where)/Makefile.config
all: PRNG.cmxa PRNG.cma
PRNG.cmxa PRNG.cma: PRNG.cmx PRNG.cmo stubs.$(O)
$(OCAMLMKLIB) -o PRNG PRNG.cmo PRNG.cmx stubs.$(O)
test/u01.exe: test/u01.ml PRNG.cmxa
$(OCAMLFIND) ocamlopt -package testu01 -linkpkg $(OCAMLFLAGS) -I . \
-o test/u01.exe \
PRNG.cmxa test/u01.ml
%.cmx: %.ml
$(OCAMLOPT) -c $*.ml
%.cmo: %.ml
$(OCAMLC) -c $*.ml
%.cmi: %.mli
$(OCAMLOPT) -c $*.mli
%.$(O): %.c
$(OCAMLC) -c $*.c
%.exe: %.ml PRNG.cmxa
$(OCAMLOPT) -I . -o $@ PRNG.cmxa $*.ml
clean::
rm -f *.cm[ioxa] *.cmxa *.$(O) *.$(A) *.$(SO)
rm -f test/*.cm[iox] test/*.$(O) test/*.exe
TOINSTALL=\
PRNG.mli PRNG.cmi PRNG.cmti \
PRNG.cma PRNG.cmxa PRNG.$(A) libPRNG.$(A) dllPRNG.$(SO)
install:
$(OCAMLFIND) install pringo META $(TOINSTALL)
uninstall:
$(OCAMLFIND) remove pringo
testresults/us-%.log: test/u01.exe
@mkdir -p testresults
./test/u01.exe -small $* > $@
testresults/um-%.log: test/u01.exe
@mkdir -p testresults
./test/u01.exe -medium $* > $@
testresults/ub-%.log: test/u01.exe
@mkdir -p testresults
./test/u01.exe -big $* > $@
testresults/ur-%.log: test/u01.exe
@mkdir -p testresults
./test/u01.exe -rabbit $* > $@
testresults/ua-%.log: test/u01.exe
@mkdir -p testresults
./test/u01.exe -alphabit $* > $@
testresults/dh-%.log: test/generator.exe
@mkdir -p testresults
./test/generator.exe $* | $(DIEHARDER) > $@
testresults/ent-%.log: test/generator.exe
@mkdir -p testresults
./test/generator.exe $* | $(ENT) > $@
clean::
rm -rf testresults
TESTS=float seq8 seq32 seq64 block-13 \
treesplit-1 treesplit-4 laggedsplit-3 splita splits
ALLTESTS=$(TESTS:%=chacha-%) $(TESTS:%=splitmix-%) $(TESTS:%=lxm-%)
SMALLTESTS=$(ALLTESTS:%=testresults/us-%.log)
smalltest: $(SMALLTESTS)
@test/reporting $(SMALLTESTS)
FULLTESTS=$(ALLTESTS:%=testresults/um-%.log) \
$(ALLTESTS:%=testresults/ur-%.log) \
$(ALLTESTS:%=testresults/ua-%.log)
fulltest: $(FULLTESTS)
@test/reporting $(FULLTESTS)
HUGETESTS=$(ALLTESTS:%=testresults/ub-%.log)
hugetest: $(HUGETESTS)
@test/reporting $(HUGETESTS)
consistencytest: test/consistency.exe
./test/consistency.exe
benchmark: test/benchmark.exe
./test/benchmark.exe
docs: *.mli
mkdir -p docs
ocamldoc -d docs/ -html *.mli
depend:
$(OCAMLDEP) *.mli *.ml > .depend
include .depend