Makefile 1.9 KB
Newer Older
1
DEBUG = -g
2
OCAMLC = ocamlc
3

4
5
PARSER = parser/location.cmo parser/ast.cmo parser/parser.cmo

6
TYPING = typing/typed.cmo typing/typer.cmo
7
8
9

TYPES  = types/recursive.cmo types/sortedList.cmo \
         types/sortedMap.cmo types/boolean.cmo \
10
         types/intervals.cmo types/chars.cmo types/atoms.cmo \
11
         types/types.cmo \
12
         types/patterns.cmo \
13
14
	 types/sequence.cmo \
	 types/builtin.cmo
15

16
17
18
DRIVER = driver/cduce.cmo

DIRS = parser typing types driver
19

20
OBJECTS = $(TYPES) $(PARSER) $(TYPING)
21
22
23
XOBJECTS = $(OBJECTS:.cmo=.cmx)
XDRIVER = $(DRIVER:.cmo=.cmx)

24
DEPEND = parser/*.ml parser/*.mli typing/*.ml typing/*.mli types/*.ml types/*.mli driver/*.mli driver/*.ml
25
INCLUDES = -I +camlp4 -I parser -I types -I typing
26
27

SYNTAX_PARSER = -pp 'camlp4o pa_extend.cmo'
28
29

all.cma: $(OBJECTS)
30
	$(OCAMLC) $(DEBUG) -o all.cma -I +camlp4 gramlib.cma nums.cma -a $(OBJECTS)
31

32
all.cmxa: $(XOBJECTS)
33
	ocamlopt -a -o all.cmxa $(XOBJECTS)
34
35


36
cduce: all.cma $(DRIVER)
37
	$(OCAMLC) $(DEBUG) -o cduce all.cma $(DRIVER)
38

39
40
41
cduce.opt: all.cmxa $(XDRIVER)
	ocamlopt -o cduce.opt -I +camlp4 gramlib.cmxa nums.cmxa all.cmxa $(XDRIVER)

42
43
compute_depend:
	@echo "Computing dependencies ..."
44
	ocamldep $(INCLUDES) $(SYNTAX_PARSER) $(DEPEND) > depend
45

46
run_top: all.cma
47
	ledit ocaml $(INCLUDES) all.cma
48
49

clean:
50
51
52
53
54
	(cd parser; rm -f *.cmi *.cmo *.cma *.cmx *.o *~)
	(cd types; rm -f *.cmi *.cmo *.cma *.cmx *.o *~)
	(cd typing; rm -f *.cmi *.cmo *.cma *.cmx *.o *~)
	(cd driver; rm -f *.cmi *.cmo *.cma *.cmx *.o *~)
	rm -f *.cmi *.cmo *.cma *.cmx *.o *~
55
	rm -f cduce
56
57
58
59

.SUFFIXES: .ml .mli .cmo .cmi .cmx

.ml.cmo:
60
	$(OCAMLC) $(DEBUG) -c $(SYNTAX_PARSER) $(INCLUDES) $<
61
.ml.cmx:
62
	ocamlopt -c $(SYNTAX_PARSER) $(INCLUDES) $<
63
64

.mli.cmi:
65
	$(OCAMLC) $(DEBUG) -c $(INCLUDES) $<
66
67
68
69
70
71
72
73
74

# FORTPATH = /users/formel8/frisch/solaris/fort/fort
FORTPATH = /home/frisch/fort
FORTBIN = $(FORTPATH)/fort
FORTLIB = $(FORTPATH)

test: all.cma
	$(FORTBIN) -I $(FORTLIB) all.cma test_fort.ml

75
include depend