]> matita.cs.unibo.it Git - helm.git/blob - helm/ocaml/cic_disambiguation/Makefile
still a working copy, now towards a cleaner implementation ...
[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
7 INTERFACE_FILES = \
8         ast.mli pp.mli macro.mli lexer.mli disambiguate.mli parser.mli \
9         disambiguate_types.mli
10 IMPLEMENTATION_FILES = \
11         pp.ml macro.ml lexer.ml disambiguate_struct.ml parser.ml \
12         disambiguate.ml \
13         $(patsubst %,%_notation.ml,$(NOTATIONS)) \
14
15 ULEXDIR := $(shell ocamlfind query ulex)
16
17 LEXER_P4_OPTS = -I $(ULEXDIR) pa_ulex.cma
18 PARSER_P4_OPTS = pa_extend.cmo ./macro.cmo ./pa_unicode_macro.cmo
19 PA_P4_OPTS = q_MLast.cmo pa_extend.cmo
20
21 all:
22
23 lexer.cmo: lexer.ml
24         $(OCAMLC) -pp "camlp4o $(LEXER_P4_OPTS)" -c $<
25 parser.cmo: parser.ml macro.cmo pa_unicode_macro.cmo
26         $(OCAMLC) -pp "camlp4o $(PARSER_P4_OPTS)" -c $<
27
28 %_notation.cmo: %_notation.ml parser.cmo
29         $(OCAMLC) -pp "camlp4o $(PARSER_P4_OPTS)" -c $<
30
31 pa_unicode_macro.cmo: pa_unicode_macro.ml macro.cmo
32         $(OCAMLC) -pp "camlp4o $(PA_P4_OPTS)" -c $<
33
34 LOCAL_LINKOPTS = -linkpkg $(PACKAGE).cma
35 test: test_lexer test_parser
36 test_lexer: test_lexer.ml $(PACKAGE).cma
37         $(OCAMLC) $(LOCAL_LINKOPTS) -o $@ $<
38 test_parser: test_parser.ml $(PACKAGE).cma
39         $(OCAMLC) $(LOCAL_LINKOPTS) -o $@ $<
40 make_table: make_table.ml
41         $(OCAMLC) -linkpkg -o $@ $<
42
43 .PHONY: macro_table.dump
44 macro_table.dump: make_table
45         ./make_table $@
46
47 clean: extra_clean
48 distclean: extra_clean
49         rm -f macro_table.dump
50 extra_clean:
51         rm -f test_lexer test_parser make_table
52
53 include ../Makefile.common
54
55 .PHONY: depend
56 depend: macro.cmi macro.cmo pa_unicode_macro.cmi pa_unicode_macro.cmo
57         $(OCAMLDEP) -pp "camlp4o $(PARSER_P4_OPTS) $(LEXER_P4_OPTS)" $(INTERFACE_FILES) $(IMPLEMENTATION_FILES) > .depend
58
59 disambiguate_types.cmi: disambiguate_types.mli
60         $(OCAMLC) -c -rectypes $<
61