Makefile 2.14 KB
Newer Older
1
DEBUG = -g
2
PACKAGES = pxp-engine,pxp-lex-iso88591,camlp4,num
3
OCAMLC = ocamlfind ocamlcp -package $(PACKAGES)
4
OCAMLOPT = ocamlfind ocamlopt  -package $(PACKAGES)
5

6
PARSER = parser/lexer.cmo parser/location.cmo parser/ast.cmo parser/parser.cmo
7

8
TYPING = typing/typed.cmo typing/typer.cmo
9
10
11

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

18
19
RUNTIME = runtime/value.cmo

20
21
DRIVER = driver/cduce.cmo

22
DIRS = parser typing types runtime driver
23

24
OBJECTS = $(TYPES) $(PARSER) $(TYPING) $(RUNTIME)
25
26
27
XOBJECTS = $(OBJECTS:.cmo=.cmx)
XDRIVER = $(DRIVER:.cmo=.cmx)

28
DEPEND = parser/*.ml parser/*.mli typing/*.ml typing/*.mli types/*.ml types/*.mli runtime/*.mli runtime/*.ml driver/*.mli driver/*.ml
29
INCLUDES = -I +camlp4 -I parser -I types -I runtime -I typing
30

31
32
#SYNTAX_PARSER = -pp 'camlp4o pa_extend.cmo'
PREPRO = camlp4o pa_extend.cmo pr_o.cmo
33
34

all.cma: $(OBJECTS)
35
	$(OCAMLC) $(DEBUG) -o all.cma -linkpkg gramlib.cma -a $(OBJECTS)
36

37
all.cmxa: $(XOBJECTS)
38
	$(OCAMLOPT) -a -o all.cmxa $(XOBJECTS)
39
40


41
42
cduce: $(OBJECTS) $(DRIVER)
	$(OCAMLC) $(DEBUG) -linkpkg -o cduce gramlib.cma $(OBJECTS) $(DRIVER)
43

44
cduce.opt: all.cmxa $(XDRIVER)
45
	$(OCAMLOPT) -linkpkg -o cduce.opt gramlib.cmxa $(XOBJECTS) $(XDRIVER)
46

47
48
compute_depend:
	@echo "Computing dependencies ..."
49
	ocamldep $(INCLUDES) $(SYNTAX_PARSER) $(DEPEND) > depend
50

51
run_top: all.cma
52
	ledit ocaml $(INCLUDES) `ocamlfind use pxp` all.cma
53
54

clean:
55
56
57
58
59
	for i in $(DIRS); do \
	(cd $$i; rm -f *.cmi *.cmo *.cma *.cmx *.o *~); \
	done
	rm -f *.cmi *.cmo *.cma *.cmx *.a *.cmxa *.o *~
	rm -f cduce cduce.opt
60
61
62
63

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

.ml.cmo:
64
65
	$(PREPRO) $< > $@pp
	$(OCAMLC) $(DEBUG) -c $(SYNTAX_PARSER) $(INCLUDES) -impl $<pp
66
.ml.cmx:
67
	$(OCAMLOPT) -c $(SYNTAX_PARSER) $(INCLUDES) $<
68
69

.mli.cmi:
70
	$(OCAMLC) $(DEBUG) -c $(INCLUDES) $<
71
72
73
74
75
76
77
78
79

# 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

80
include depend