-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
111 lines (83 loc) · 3.15 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: fbuoro <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2015/06/24 10:51:44 by fbuoro #+# #+# #
# Updated: 2016/02/08 12:02:00 by ngoguey ### ########.fr #
# #
# **************************************************************************** #
NAME = ft_turing
SRCSFILES = Action.ml MonadicTry.ml YojsonTreeMatcher.ml
INTSFILES = Action.mli MonadicTry.mli YojsonTreeMatcher.mli
SRCSFILES += ProgramDataTmp.ml YojsonTree.ml ProgramData.ml
INTSFILES += ProgramDataTmp.mli YojsonTree.mli
SRCSFILES += Tape.ml LoopGuard.ml
SRCSFILES += Verifier.ml StringListTickTock.ml Complexity_classes.ml Order.ml
SRCSFILES += Convert.ml Complexity.ml
SRCSFILES += Arguments.ml Main.ml
SRCDIR = ./srcs
CAMLC = ocamlc
CAMLOPT = ocamlopt
GNUPLOT = -I ./gnuplot-ocaml/_build/lib
LD_GNUPLOT = $(GNUPLOT) gnuplot.cmxa
FLAGS = $(GNUPLOT) -thread -package core,yojson
LD_FLAGS = $(LD_GNUPLOT) -linkpkg
LD_FLAGS_BYT = $(LD_FLAGS:.cmxa=.cma)
LD_FLAGS_OPT = $(LD_FLAGS)
all: $(NAME)
$(NAME): opt byt
@ln -sf $(NAME).opt $(NAME)
opt: $(NAME).opt
byt: $(NAME).byt
SRCS = $(addprefix $(SRCDIR)/,$(SRCSFILES))
INTS = $(addprefix $(SRCDIR)/,$(INTSFILES))
OBJS = $(SRCS:.ml=.cmo)
OPTOBJS = $(SRCS:.ml=.cmx)
CMI = $(INTS:.mli=.cmi)
$(NAME).byt: $(CMI) $(OBJS)
ocamlfind ocamlc $(LD_FLAGS_BYT) $(FLAGS) -o $(NAME).byt $(OBJS)
$(NAME).opt: $(CMI) $(OPTOBJS)
ocamlfind ocamlopt $(LD_FLAGS_OPT) $(FLAGS) -o $(NAME).opt $(OPTOBJS)
.SUFFIXES:
.SUFFIXES: .ml .mli .cmo .cmi .cmx
.ml.cmo:
ocamlfind ocamlc $(FLAGS) -I $(SRCDIR) -c $<
.mli.cmi:
ocamlfind ocamlc $(FLAGS) -I $(SRCDIR) $< -o $@
.ml.cmx:
ocamlfind ocamlopt $(FLAGS) -I $(SRCDIR) -c $<
clean:
rm -f $(SRCDIR)/*.cm[iox] $(SRCDIR)/*.o
rm -f $(SRCDIR)/$(NAME).o
fclean: clean
rm -f $(NAME)
rm -f $(NAME).opt
rm -f $(NAME).byt
install_libs: #with a working brew on macos
hash -r
type ocaml || brew install --build-from-source ocaml
hash -r
type opam ||\
(brew install opam &&\
opam init -n &&\
(~/.opam/opam-init/init.zsh > /dev/null 2>/dev/null || true) &&\
eval `opam config env` &&\
opam switch 4.02.3 &&\
(~/.opam/opam-init/init.zsh > /dev/null 2>/dev/null || true) &&\
eval `opam config env`\
)
opam install -y core.113.00.00
# ls -d ~/.opam/4.02.3/lib/core || opam install -y core
ls -d ~/.opam/4.02.3/lib/yojson || opam install -y yojson
hash -r
type ocamlfind || opam install -y ocamlfind
hash -r
type gnuplot || brew install gnuplot
ls -d ./gnuplot-ocaml ||\
(git clone https://github.com/Ngoguey42/gnuplot-ocamlFORK gnuplot-ocaml &&\
$(MAKE) -C gnuplot-ocaml\
)
re: fclean all