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