-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmakefile
48 lines (38 loc) · 1.01 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
OFLAGS = -I src
SRC = src/utils.ml \
src/proto.ml \
src/scan.ml \
src/parsec.ml \
src/validate.ml \
src/proto_log.ml \
src/proto_run.ml \
src/gen_spec.ml \
src/gen_code.ml \
src/gen_test.ml \
MLI = $(patsubst %.ml, %.mli, $(SRC))
CMI = $(patsubst %.ml, %.cmi, $(SRC))
CMO = $(patsubst %.ml, %.cmo, $(SRC))
CC = gcc -std=gnu99
CFLAGS = -pedantic -Wall -Wextra
.PHONY: all clean repl gen
all: gen src/repl.out
repl: src/repl.out
clean:
rm -f src/*.cmi src/*.cmo
rm -f src/scan.ml
rm -f *.out src/*.out
rm -rf classic elligator
gen: gen.out protocols.txt
./gen.out < protocols.txt
(cd classic; make test)
(cd elligator; make test)
gen.out: src/main.ml $(CMO)
ocamlc $(OFLAGS) str.cma unix.cma $(CMO) $< -o $@
src/repl.out: $(CMO) $(CMI)
ocamlmktop $(OFLAGS) str.cma unix.cma $(CMO) -o $@
%.cmi : %.mli $(MLI)
ocamlc $< $(OFLAGS) -c
%.cmo : %.ml $(CMI)
ocamlc $< $(OFLAGS) -c
src/scan.ml: src/scan.mll
ocamllex $< -o $@