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