]> matita.cs.unibo.it Git - helm.git/blob - helm/ocaml/cic_disambiguation/Makefile
no longer use marshalled table for unicode macros
[helm.git] / helm / ocaml / cic_disambiguation / Makefile
1
2 PACKAGE = cic_textual_parser2
3 REQUIRES = \
4         helm-tactics helm-logger helm-cic_unification helm-cic_transformations \
5         ulex pxp camlp4.gramlib
6 NOTATIONS = logic arit tex
7 INTERFACE_FILES = \
8         disambiguateTypes.mli \
9         disambiguateChoices.mli \
10         macro_table.mli \
11         cicTextualParser2Macro.mli \
12         cicTextualLexer2.mli \
13         cicTextualParser2.mli \
14         disambiguate.mli
15 IMPLEMENTATION_FILES = \
16         $(patsubst %.mli, %.ml, $(INTERFACE_FILES)) \
17         $(patsubst %,%_notation.ml,$(NOTATIONS))
18
19 ULEXDIR := $(shell ocamlfind query ulex)
20
21 LEXER_P4_OPTS = -I $(ULEXDIR) pa_ulex.cma
22 PARSER_P4_OPTS = \
23         pa_extend.cmo \
24         ./macro_table.cmo \
25         ./cicTextualParser2Macro.cmo \
26         ./pa_unicode_macro.cmo
27 PA_P4_OPTS = q_MLast.cmo pa_extend.cmo
28
29 all:
30
31 cicTextualLexer2.cmo: cicTextualLexer2.ml
32         $(OCAMLC) -pp "camlp4o $(LEXER_P4_OPTS)" -c $<
33 cicTextualParser2.cmo: cicTextualParser2.ml cicTextualParser2Macro.cmo pa_unicode_macro.cmo
34         $(OCAMLC) -pp "camlp4o $(PARSER_P4_OPTS)" -c $<
35 cicTextualLexer2.cmx: cicTextualLexer2.ml
36         $(OCAMLOPT) -pp "camlp4o $(LEXER_P4_OPTS)" -c $<
37 cicTextualParser2.cmx: cicTextualParser2.ml cicTextualParser2Macro.cmo pa_unicode_macro.cmo
38         $(OCAMLOPT) -pp "camlp4o $(PARSER_P4_OPTS)" -c $<
39
40 %_notation.cmo: %_notation.ml cicTextualParser2.cmo
41         $(OCAMLC) -pp "camlp4o $(PARSER_P4_OPTS)" -c $<
42 %_notation.cmx: %_notation.ml cicTextualParser2.cmx
43         $(OCAMLOPT) -pp "camlp4o $(PARSER_P4_OPTS)" -c $<
44
45 pa_unicode_macro.cmo: pa_unicode_macro.ml cicTextualParser2Macro.cmo
46         $(OCAMLC) -pp "camlp4o $(PA_P4_OPTS)" -c $<
47 pa_unicode_macro.cmx: pa_unicode_macro.ml cicTextualParser2Macro.cmx
48         $(OCAMLOPT) -pp "camlp4o $(PA_P4_OPTS)" -c $<
49
50 LOCAL_LINKOPTS = -linkpkg $(PACKAGE).cma
51 test: test_lexer test_parser
52 test_lexer: test_lexer.ml $(PACKAGE).cma
53         $(OCAMLC) $(LOCAL_LINKOPTS) -o $@ $<
54 test_parser: test_parser.ml $(PACKAGE).cma
55         $(OCAMLC) $(LOCAL_LINKOPTS) -o $@ $<
56 make_table: make_table.ml
57         $(OCAMLFIND) ocamlc -package pxp -linkpkg -o $@ $^
58
59 macro_table.ml: make_table
60         ./make_table $@
61 macro_table.cmo: macro_table.ml
62         $(OCAMLFIND) ocamlc -c $<
63
64 clean: extra_clean
65 distclean: extra_clean
66         rm -f macro_table.dump
67 extra_clean:
68         rm -f test_lexer test_parser make_table
69
70 include ../Makefile.common
71
72 .PHONY: depend
73 depend: cicTextualParser2Macro.cmi cicTextualParser2Macro.cmo pa_unicode_macro.cmi pa_unicode_macro.cmo
74         $(OCAMLDEP) -pp "camlp4o $(PARSER_P4_OPTS) $(LEXER_P4_OPTS)" $(INTERFACE_FILES) $(IMPLEMENTATION_FILES) > .depend
75
76 disambiguateTypes.cmi: disambiguateTypes.mli
77         $(OCAMLC) -c -rectypes $<
78 disambiguateTypes.cmo: disambiguateTypes.ml disambiguateTypes.cmi
79         $(OCAMLC) -c -rectypes $<
80 disambiguateTypes.cmx: disambiguateTypes.ml disambiguateTypes.cmi
81         $(OCAMLOPT) -c -rectypes $<
82