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