]> matita.cs.unibo.it Git - helm.git/blob - helm/ocaml/cic_disambiguation/Makefile
added tex notation
[helm.git] / helm / ocaml / cic_disambiguation / Makefile
1
2 PACKAGE = cic_textual_parser2
3 REQUIRES = \
4         ulex pxp helm-tactics helm-cic helm-logger helm-cic_unification \
5         camlp4.gramlib
6 NOTATIONS = logic arit tex
7 INTERFACE_FILES = \
8         cicTextualParser2Ast.mli \
9         cicTextualParser2Pp.mli \
10         macro.mli \
11         cicTextualLexer2.mli \
12         disambiguate.mli \
13         cicTextualParser2.mli \
14         disambiguateTypes.mli
15 IMPLEMENTATION_FILES = \
16         disambiguateTypes.ml \
17         cicTextualParser2Pp.ml \
18         macro.ml \
19         cicTextualLexer2.ml \
20         cicTextualParser2.ml \
21         disambiguate.ml \
22         $(patsubst %,%_notation.ml,$(NOTATIONS)) \
23
24 ULEXDIR := $(shell ocamlfind query ulex)
25
26 LEXER_P4_OPTS = -I $(ULEXDIR) pa_ulex.cma
27 PARSER_P4_OPTS = pa_extend.cmo ./macro.cmo ./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 macro.cmo pa_unicode_macro.cmo
35         $(OCAMLC) -pp "camlp4o $(PARSER_P4_OPTS)" -c $<
36
37 %_notation.cmo: %_notation.ml cicTextualParser2.cmo
38         $(OCAMLC) -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
43 LOCAL_LINKOPTS = -linkpkg $(PACKAGE).cma
44 test: test_lexer test_parser
45 test_lexer: test_lexer.ml $(PACKAGE).cma
46         $(OCAMLC) $(LOCAL_LINKOPTS) -o $@ $<
47 test_parser: test_parser.ml $(PACKAGE).cma
48         $(OCAMLC) $(LOCAL_LINKOPTS) -o $@ $<
49 make_table: make_table.ml
50         $(OCAMLC) -linkpkg -o $@ $<
51
52 .PHONY: macro_table.dump
53 macro_table.dump: make_table
54         ./make_table $@
55
56 clean: extra_clean
57 distclean: extra_clean
58         rm -f macro_table.dump
59 extra_clean:
60         rm -f test_lexer test_parser make_table
61
62 include ../Makefile.common
63
64 .PHONY: depend
65 depend: macro.cmi macro.cmo pa_unicode_macro.cmi pa_unicode_macro.cmo
66         $(OCAMLDEP) -pp "camlp4o $(PARSER_P4_OPTS) $(LEXER_P4_OPTS)" $(INTERFACE_FILES) $(IMPLEMENTATION_FILES) > .depend
67
68 disambiguateTypes.cmi: disambiguateTypes.mli
69         $(OCAMLC) -c -rectypes $<
70 disambiguateTypes.cmo: disambiguateTypes.ml disambiguateTypes.cmi
71         $(OCAMLC) -c -rectypes $<
72