-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
44 lines (32 loc) · 1010 Bytes
/
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
BUILD_PKGS=
TEST_PKGS=oUnit
BUILD_FLAGS=-Is src
DEBUG_FLAGS=-tag 'debug'
TEST_FLAGS=-use-ocamlfind -pkgs ${TEST_PKGS} -Is src
# ^: add -build-dir _build to put .native in _build/
# add -- after .native below to run immediately
default: build
build:
ocamlbuild ${BUILD_FLAGS} src/main.native
gcc -c runtime/runtime.c -o runtime/runtime.o
repl:
ocamlbuild ${BUILD_FLAGS} src/repl.native
debug:
ocamlbuild ${BUILD_FLAGS} ${DEBUG_FLAGS} src/main.d.byte
gcc -c runtime/runtime.c -o runtime/runtime.o
doc:
ocamldoc -html src/*mli -d docs
output:
gcc -c output.S -o output.o
gcc -c runtime/runtime.c -o runtime/runtime.o
gcc output.o runtime/runtime.o -o output
test:
ocamlbuild ${BUILD_FLAGS} ${TEST_FLAGS} ${DEBUG_FLAGS} tests/test.d.byte
ocamlbuild ${TEST_FLAGS} tests/test.native --
ex:
ocamlbuild ${TEST_FLAGS} tests/exampleTests.native --
clean:
ocamlbuild -clean
rm -f docs/* *.native
# Add Jane Street
# opam repo add janestreet-bleeding https://ocaml.janestreet.com/opam-repository