Makefile 1.59 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
COMPILER	?= ocamlbuild
ROOTDIR		?= ../..
SRCDIR		?= src
EXTDIR		?= $(SRCDIR)/externals

INEXTFILES	= misc/custom.ml misc/encodings.ml misc/upool.ml misc/ns.ml\
 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\
 types/builtin_defs.ml parser/ast.ml typing/typepat.mli typing/typepat.ml\
 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
23
24
25
26
27
EXTFILES	= $(INEXTFILES:%=$(ROOTDIR)/%)

RM		?= rm -f
OUT		?= main.native
OUTDEBUG	?= main.byte

28
.PHONY: clean _import
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
39
40
41
42
43
44

_import:
	@echo -n "Copying external files..."
	@test -d $(EXTDIR) || mkdir $(EXTDIR)
	@cp $(EXTFILES) $(EXTDIR)
	@echo "done"

clean:
	$(COMPILER) -clean
	test $(EXTDIR) = "src" || test $(EXTDIR) = "." || $(RM) -r $(EXTDIR)