Commit | Line | Data |
---|---|---|
1c975d08 SK |
1 | MAKEFLAGS := --no-builtin-rules |
2 | ||
129abbe9 | 3 | EXE_TYPE := byte # byte | native |
d3bdde4b | 4 | EXECUTABLES := tigerc tigert |
129abbe9 SK |
5 | OCAMLBUILD_FLAGS_DIRS := -I src/exe -I src/lib/tiger |
6 | OCAMLBUILD_FLAGS_COMP := -cflags '-w A' | |
4309a757 | 7 | OCAMLBUILD_FLAGS_YACC := -yaccflag '-v' |
a9002dfe SK |
8 | OCAMLBUILD := \ |
9 | ocamlbuild \ | |
a9002dfe | 10 | $(OCAMLBUILD_FLAGS_COMP) \ |
4309a757 SK |
11 | $(OCAMLBUILD_FLAGS_DIRS) \ |
12 | $(OCAMLBUILD_FLAGS_YACC) | |
1c975d08 SK |
13 | |
14 | .PHONY: \ | |
a9002dfe SK |
15 | all \ |
16 | build \ | |
17 | clean \ | |
18 | test | |
1c975d08 | 19 | |
a4905b7a | 20 | all: clean |
78c9eca5 | 21 | @$(MAKE) -s test |
1c975d08 SK |
22 | |
23 | build: | |
78c9eca5 SK |
24 | @$(OCAMLBUILD) $(addsuffix .$(EXE_TYPE),$(EXECUTABLES)) |
25 | @mkdir -p bin/exe | |
26 | $(foreach exe,$(EXECUTABLES),cp _build/src/exe/$(exe).$(EXE_TYPE) bin/exe/$(exe); ) | |
27 | @rm $(addsuffix .$(EXE_TYPE),$(EXECUTABLES)) | |
1c975d08 SK |
28 | |
29 | clean: | |
78c9eca5 SK |
30 | @$(OCAMLBUILD) -clean |
31 | @rm -rf ./bin | |
1c975d08 | 32 | |
a4905b7a | 33 | test: build |
d3bdde4b | 34 | @./bin/exe/tigert |