-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
47 lines (37 loc) · 1.19 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
TARGET=src/dice
LIBS=-I,/usr/lib/ocaml/ -I/home/$USER/.opam/system/lib/llvm/.
FLAGS= -j 0 -r -use-ocamlfind -pkgs yojson,llvm,llvm.analysis,llvm.bitwriter,llvm.bitreader,llvm.linker,llvm.target,batteries
OCAMLBUILD=ocamlbuild
OPAM=opam config env
CLIBEXT=_includes
.PHONY: master.pdf all clean pdf pdfclean
all: native
@clang-3.8 -c -emit-llvm src/bindings.c
@mkdir -p $(CLIBEXT)
@mv bindings.bc $(CLIBEXT)/bindings.bc
@cp src/stdlib.dice $(CLIBEXT)/stdlib.dice
@mv dice.native dice
@echo Compilation Complete
clean: pdfclean
@cd src
$(OCAMLBUILD) -clean
@cd ..
@rm -rf $(CLIBEXT)
@echo cleaning complete
pdfclean:
@cd report;latexmk -CA;rm -rf ./_minted-master;rm -f ./Code/code.tex;rm -f ./Code/tests.tex;rm -f ./Code/demo.tex;rm -f ./Includes/gitlog.tex
native:
@cd src
@eval `opam config env`
$(OCAMLBUILD) $(FLAGS) $(TARGET).native
@cd ..
byte:
$(OCAMLBUILD) $(FLAGS) $(TARGET).byte
pdf: master.pdf
master.pdf:
@cd report; ls; python make_tex.py; pdflatex -synctex=1 -interaction=nonstopmode "master".tex -shell-escape; mv master.pdf ../dice.pdf
@echo dice.pdf created
depend:
echo "Not needed."
test:
@cd tests; bash tester.sh; cd ..