Makefile 1.79 KB
Newer Older
1
2
3
4
5
COMPILER	?= ocamlbuild
ROOTDIR		?= ../..
SRCDIR		?= src
EXTDIR		?= $(SRCDIR)/externals

6
INEXTFILES  = misc/custom.ml misc/encodings.ml misc/upool.ml misc/ns.ml\
7
8
 types/sortedList.ml types/ident.ml misc/html.ml types/sequence.ml\
 types/patterns.ml parser/cduce_loc.mli parser/cduce_loc.ml typing/typed.ml\
9
 types/builtin_defs.ml parser/ast.ml parser/parser.ml parser/ulexer.ml typing/typepat.mli typing/typepat.ml\
10
11
12
 types/externals.mli types/externals.ml typing/typer.ml\
 runtime/run_dispatch.ml runtime/explain.ml schema/schema_pcre.ml\
 schema/schema_xml.mli schema/schema_xml.ml schema/schema_common.mli\
13
 schema/schema_common.ml runtime/eval.mli runtime/eval.ml\
14
15
16
17
18
19
20
21
 compile/compile.ml types/compunit.mli types/compunit.ml types/var.ml\
 types/boolVar.ml misc/imap.ml types/atoms.ml types/intervals.ml\
 types/chars.mli types/chars.ml misc/bool.mli misc/bool.ml types/types.mli\
 misc/stats.mli misc/stats.ml types/normal.mli types/normal.ml misc/pretty.mli\
 misc/pretty.ml types/types.ml compile/auto_pat.mli runtime/value.mli\
 runtime/value.ml schema/schema_types.mli schema/schema_validator.mli\
 schema/schema_builtin.mli schema/schema_builtin.ml schema/schema_validator.ml\
 compile/lambda.ml
22
EXTFILES  = $(INEXTFILES:%=$(ROOTDIR)/%)
23
24

RM		?= rm -f
Pietro Abate's avatar
Pietro Abate committed
25
26
OUT		?= valueTests.native lambdaTests.native typedTests.native astprinter.native
OUTDEBUG	?= valueTests.native lambdaTests.byte typedTests.byte astprinter.byte
27

28
.PHONY: clean _import tests
29
30

all: _import
31
	$(COMPILER) -use-ocamlfind $(OUT)
32
33

debug: _import
Julien Lopez's avatar
Julien Lopez committed
34
	$(COMPILER) -use-ocamlfind -tag debug $(OUTDEBUG)
35

36
37
38
tests:
	make -C tests

39
40
41
42
43
44
45
_import:
	@echo -n "Copying external files..."
	@test -d $(EXTDIR) || mkdir $(EXTDIR)
	@cp $(EXTFILES) $(EXTDIR)
	@echo "done"

clean:
46
	make -C tests clean
47
48
	$(COMPILER) -clean
	test $(EXTDIR) = "src" || test $(EXTDIR) = "." || $(RM) -r $(EXTDIR)