]> matita.cs.unibo.it Git - helm.git/blob - helm/ocaml/cic_disambiguation/Makefile
new experimental cic textual parser: checkin
[helm.git] / helm / ocaml / cic_disambiguation / Makefile
1
2 PACKAGE = cic_textual_parser2
3 REQUIRES = ulex camlp4 pxp
4 INTERFACE_FILES = ast.mli pp.mli macro.mli lexer.mli
5 NOTATIONS = logic arit
6 IMPLEMENTATION_FILES = \
7         pp.ml macro.ml lexer.ml parser.ml \
8         $(patsubst %,%_notation.ml,$(NOTATIONS))
9
10 ULEXDIR := $(shell ocamlfind query ulex)
11
12 LEXER_P4_OPTS = -I $(ULEXDIR) pa_ulex.cma
13 PARSER_P4_OPTS = pa_extend.cmo ./macro.cmo ./pa_unicode_macro.cmo
14 PA_P4_OPTS = q_MLast.cmo pa_extend.cmo
15
16 include ../Makefile.common
17
18 lexer.cmo: lexer.ml
19         $(OCAMLC) -pp "camlp4o $(LEXER_P4_OPTS)" -c $<
20 parser.cmo: parser.ml macro.cmo pa_unicode_macro.cmo
21         $(OCAMLC) -pp "camlp4o $(PARSER_P4_OPTS)" -c $<
22
23 %_notation.cmo: %_notation.ml parser.cmo
24         $(OCAMLC) -pp "camlp4o $(PARSER_P4_OPTS)" -c $<
25
26 pa_unicode_macro.cmo: pa_unicode_macro.ml macro.cmo
27         $(OCAMLC) -pp "camlp4o $(PA_P4_OPTS)" -c $<
28
29 LOCAL_LINKOPTS = -linkpkg gramlib.cma $(PACKAGE).cma
30 test: test_lexer test_parser
31 test_lexer: test_lexer.ml $(PACKAGE).cma
32         $(OCAMLC) $(LOCAL_LINKOPTS) -o $@ $<
33 test_parser: test_parser.ml $(PACKAGE).cma
34         $(OCAMLC) $(LOCAL_LINKOPTS) -o $@ $<
35 make_table: make_table.ml
36         $(OCAMLC) -linkpkg -o $@ $<
37
38 .PHONY: macro_table.dump
39 macro_table.dump: make_table
40         ./make_table $@
41
42 clean: extra_clean
43 distclean: extra_clean
44         rm -f macro_table.dump
45 extra_clean:
46         rm -f test_lexer test_parser make_table
47