-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
41 lines (31 loc) · 1.32 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
OCAMLPATH = `ocamlc -where`
CC = gcc
# from dSFMT-src-2.2/Makefile, with slight editing:
WARN = -Wmissing-prototypes -W -Winline
OPTI = -O3 -finline-functions -fomit-frame-pointer -DNDEBUG \
-fno-strict-aliasing --param max-inline-insns-single=1800
STD = -std=c99
CCFLAGS = $(OPTI) $(WARN) $(STD)
CCFLAGS += --param inline-unit-growth=500 --param large-function-growth=900
SSE2FLAGS = -msse2 -DHAVE_SSE2
# These I added:
MFLAG = -DDSFMT_MEXP=19937
ARCHFLAG = -march=native
CCFLAGS += $(STD) $(SSE2FLAGS) $(MFLAG) $(ARCHFLAG) -fPIC
dSFMTDIR = dSFMT-src-2.2.3
all: dsfmt.cmi dsfmt.cmo dsfmt.cma dlldsfmt.so \
dsfmt.o dsfmt.cmx dsfmt.a dsfmt.cmxa libdsfmt.a
dSFMT_c.o: $(dSFMTDIR)/dSFMT.c $(dSFMTDIR)/dSFMT.h \
$(dSFMTDIR)/dSFMT-params.h $(dSFMTDIR)/dSFMT-params19937.h
$(CC) $(CCFLAGS) -c $< -o $@
dsfmt-wrap.o: dsfmt-wrap.c $(dSFMTDIR)/dSFMT.h
$(CC) $(CCFLAGS) -I $(OCAMLPATH) -I$(dSFMTDIR) -c $<
dsfmt.cmi dlldsfmt.so dsfmt.cmo dsfmt.cma libdsfmt.a dsfmt.o dsfmt.cmx \
dsfmt.a dsfmt.cmxa: dsfmt.ml dsfmt-wrap.o dSFMT_c.o
ocamlmklib -v -ocamlopt "ocamlopt -inline 2" -o dsfmt $^
# other possible optimization options:
# ocamlopt -linkall -nodynlink -unsafe -noassert
clean:
rm dsfmt-wrap.o dSFMT_c.o \
dsfmt.cmi dsfmt.cmo dsfmt.cma dlldsfmt.so \
dsfmt.o dsfmt.cmx dsfmt.a dsfmt.cmxa libdsfmt.a