Add CLI options to execute different test suites
[tiger.ml.git] / compiler / Makefile
CommitLineData
1c975d08
SK
1MAKEFLAGS := --no-builtin-rules
2
fca49f4f
SK
3DIR_TEST_CASES := ./testcases
4
b53d50d3 5EXE_TYPE := native # byte | native
d3bdde4b 6EXECUTABLES := tigerc tigert
38ffcb1f 7OCAMLBUILD_FLAGS_PKGS := -pkg unix
129abbe9 8OCAMLBUILD_FLAGS_DIRS := -I src/exe -I src/lib/tiger
b53d50d3 9OCAMLBUILD_FLAGS_COMP := -cflags '-g -w A'
4309a757 10OCAMLBUILD_FLAGS_YACC := -yaccflag '-v'
a9002dfe
SK
11OCAMLBUILD := \
12 ocamlbuild \
38ffcb1f 13 $(OCAMLBUILD_FLAGS_PKGS) \
a9002dfe 14 $(OCAMLBUILD_FLAGS_COMP) \
4309a757
SK
15 $(OCAMLBUILD_FLAGS_DIRS) \
16 $(OCAMLBUILD_FLAGS_YACC)
1c975d08
SK
17
18.PHONY: \
a9002dfe
SK
19 all \
20 build \
21 clean \
fca49f4f
SK
22 test_all \
23 test_book \
24 test_micro \
a9002dfe 25 test
1c975d08 26
a4905b7a 27all: clean
78c9eca5 28 @$(MAKE) -s test
1c975d08
SK
29
30build:
78c9eca5
SK
31 @$(OCAMLBUILD) $(addsuffix .$(EXE_TYPE),$(EXECUTABLES))
32 @mkdir -p bin/exe
33 $(foreach exe,$(EXECUTABLES),cp _build/src/exe/$(exe).$(EXE_TYPE) bin/exe/$(exe); )
34 @rm $(addsuffix .$(EXE_TYPE),$(EXECUTABLES))
1c975d08
SK
35
36clean:
78c9eca5
SK
37 @$(OCAMLBUILD) -clean
38 @rm -rf ./bin
1c975d08 39
fca49f4f
SK
40test: test_all
41
42test_all: build
43 @./bin/exe/tigert all -dir $(DIR_TEST_CASES)
44
45test_book: build
46 @./bin/exe/tigert book -dir $(DIR_TEST_CASES)
47
48test_micro: build
49 @./bin/exe/tigert micro
This page took 0.024529 seconds and 4 git commands to generate.