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