-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
51 lines (40 loc) · 1.22 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
EXEC=bff
TOOLS=tools
LIST=bfflist
LEXER=lexer
RUNTIME=runtime
COMPILER=compiler
MAIN=main
SRC=src/
TMP=tmp/
BIN=bin/
OCAMLC=ocamlc
OCAMLCFLAGSI=-i
OCAMLCFLAGSB=-c -dtypes
LIBS=unix.cma
.PHONY: all clean clean-tmp runtest
all: clean
mkdir -p $(TMP)
mkdir -p $(BIN)
cp $(SRC)* $(TMP)
cd $(TMP) && $(OCAMLC) $(OCAMLCFLAGSI) $(LIST).ml > $(LIST).mli
cd $(TMP) && $(OCAMLC) $(OCAMLCFLAGSI) $(TOOLS).ml > $(TOOLS).mli
cd $(TMP) && $(OCAMLC) $(OCAMLCFLAGSI) $(LEXER).ml > $(LEXER).mli
cd $(TMP) && $(OCAMLC) $(OCAMLCFLAGSI) $(RUNTIME).ml > $(RUNTIME).mli
cd $(TMP) && $(OCAMLC) $(OCAMLCFLAGSB) $(LIST).mli $(LIST).ml
cd $(TMP) && $(OCAMLC) $(OCAMLCFLAGSB) $(TOOLS).mli $(TOOLS).ml
cd $(TMP) && $(OCAMLC) $(OCAMLCFLAGSB) $(LEXER).mli $(LEXER).ml
cd $(TMP) && $(OCAMLC) $(OCAMLCFLAGSB) $(RUNTIME).mli $(RUNTIME).ml
cd $(TMP) && $(OCAMLC) $(OCAMLCFLAGSB) $(COMPILER).ml
cd $(TMP) && $(OCAMLC) $(OCAMLCFLAGSB) $(MAIN).ml
cd $(TMP) && $(OCAMLC) -o $(EXEC) $(LIBS) $(TOOLS).cmo $(LIST).cmo $(LEXER).cmo $(RUNTIME).cmo $(COMPILER).cmo $(MAIN).cmo
cp $(TMP)$(EXEC) $(BIN)$(EXEC)
clean-tmp:
rm -rf $(TMP)*
clean: clean-tmp
mkdir -p $(BIN)
rm -rf $(BIN)*
echo "*" > $(BIN).gitignore
runtest:
chmod +x test/test.sh
./test/test.sh