-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
45 lines (32 loc) · 1.08 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
TARGET = main
INSTALL_TARGET = $(shell opam config var bin)/rubytt
SRC=src
OCAMLBUILD = cd $(SRC); corebuild -use-ocamlfind -pkg yojson,alcotest,str,stringext -cflags -w,-29,-w,-45,-w,-11,-w,-27,-w,-26
default: byte
all: byte native test dot
prepare_dump:
$(OCAMLBUILD) gen_dump.byte; ./gen_dump.byte; cd ../;
byte: prepare_dump
$(OCAMLBUILD) $(TARGET).byte; cp $(TARGET).byte ../bin; cd ../;
native: prepare_dump
$(OCAMLBUILD) $(TARGET).native; cp $(TARGET).native ../bin; cd ../;
test: byte
$(OCAMLBUILD) test.native;
./src/test.native -e
update:
$(OCAMLBUILD) test.native;
./src/test.native -u
dot:
$(OCAMLBUILD) proj.docdir/dep.dot;
# remove the line of "rotate=90"
grep -vwE "(rotate)" ./src/_build/proj.docdir/dep.dot > dep.dot;
cd src; dot dep.dot -Tpng -o dep.png
install: native
if [ -a ./bin/main.native ]; then cp ./bin/main.native $(INSTALL_TARGET); fi;
remove:
if [ -a $(INSTALL_TARGET) ]; then sudo rm -rf $(INSTALL_TARGET); fi;
opam_install: native
if [ -a ./bin/main.native ]; then echo "main.native is compiled"; fi;
clean:
$(OCAMLBUILD) -clean
rm -rf _tests