20fdb3d9d57962d9f38410855a265d2664f1fc19
[tiger.ml.git] / compiler / Makefile
1 MAKEFLAGS := --no-builtin-rules
2
3 EXE_TYPE := byte # byte | native
4 EXECUTABLES := tigerc tigert
5 OCAMLBUILD_FLAGS_DIRS := -I src/exe -I src/lib/tiger
6 OCAMLBUILD_FLAGS_COMP := -cflags '-w A'
7 OCAMLBUILD_FLAGS_YACC := -yaccflag '-v'
8 OCAMLBUILD := \
9 ocamlbuild \
10 $(OCAMLBUILD_FLAGS_COMP) \
11 $(OCAMLBUILD_FLAGS_DIRS) \
12 $(OCAMLBUILD_FLAGS_YACC)
13
14 .PHONY: \
15 all \
16 build \
17 clean \
18 test
19
20 all: clean
21 @$(MAKE) -s test
22
23 build:
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))
28
29 clean:
30 @$(OCAMLBUILD) -clean
31 @rm -rf ./bin
32
33 test: build
34 @./bin/exe/tigert
This page took 0.045324 seconds and 3 git commands to generate.