2 PACKAGE = cic_textual_parser2
4 helm-tactics helm-logger helm-cic_unification helm-cic_transformations \
5 ulex pxp camlp4.gramlib
6 NOTATIONS = logic arit tex
8 disambiguateTypes.mli \
9 disambiguateChoices.mli \
11 cicTextualLexer2.mli \
12 cicTextualParser2.mli \
14 IMPLEMENTATION_FILES = \
15 $(patsubst %.mli, %.ml, $(INTERFACE_FILES)) \
16 $(patsubst %,%_notation.ml,$(NOTATIONS))
18 ULEXDIR := $(shell ocamlfind query ulex)
20 LEXER_P4_OPTS = -I $(ULEXDIR) pa_ulex.cma
21 PARSER_P4_OPTS = pa_extend.cmo ./macro.cmo ./pa_unicode_macro.cmo
22 PA_P4_OPTS = q_MLast.cmo pa_extend.cmo
26 cicTextualLexer2.cmo: cicTextualLexer2.ml
27 $(OCAMLC) -pp "camlp4o $(LEXER_P4_OPTS)" -c $<
28 cicTextualParser2.cmo: cicTextualParser2.ml macro.cmo pa_unicode_macro.cmo
29 $(OCAMLC) -pp "camlp4o $(PARSER_P4_OPTS)" -c $<
30 cicTextualLexer2.cmx: cicTextualLexer2.ml
31 $(OCAMLOPT) -pp "camlp4o $(LEXER_P4_OPTS)" -c $<
32 cicTextualParser2.cmx: cicTextualParser2.ml macro.cmo pa_unicode_macro.cmo
33 $(OCAMLOPT) -pp "camlp4o $(PARSER_P4_OPTS)" -c $<
35 %_notation.cmo: %_notation.ml cicTextualParser2.cmo
36 $(OCAMLC) -pp "camlp4o $(PARSER_P4_OPTS)" -c $<
37 %_notation.cmx: %_notation.ml cicTextualParser2.cmx
38 $(OCAMLOPT) -pp "camlp4o $(PARSER_P4_OPTS)" -c $<
40 pa_unicode_macro.cmo: pa_unicode_macro.ml macro.cmo
41 $(OCAMLC) -pp "camlp4o $(PA_P4_OPTS)" -c $<
42 pa_unicode_macro.cmx: pa_unicode_macro.ml macro.cmx
43 $(OCAMLOPT) -pp "camlp4o $(PA_P4_OPTS)" -c $<
45 LOCAL_LINKOPTS = -linkpkg $(PACKAGE).cma
46 test: test_lexer test_parser
47 test_lexer: test_lexer.ml $(PACKAGE).cma
48 $(OCAMLC) $(LOCAL_LINKOPTS) -o $@ $<
49 test_parser: test_parser.ml $(PACKAGE).cma
50 $(OCAMLC) $(LOCAL_LINKOPTS) -o $@ $<
51 make_table: make_table.ml
52 $(OCAMLC) -linkpkg -o $@ $<
54 .PHONY: macro_table.dump
55 macro_table.dump: make_table
59 distclean: extra_clean
60 rm -f macro_table.dump
62 rm -f test_lexer test_parser make_table
64 include ../Makefile.common
67 depend: macro.cmi macro.cmo pa_unicode_macro.cmi pa_unicode_macro.cmo
68 $(OCAMLDEP) -pp "camlp4o $(PARSER_P4_OPTS) $(LEXER_P4_OPTS)" $(INTERFACE_FILES) $(IMPLEMENTATION_FILES) > .depend
70 disambiguateTypes.cmi: disambiguateTypes.mli
71 $(OCAMLC) -c -rectypes $<
72 disambiguateTypes.cmo: disambiguateTypes.ml disambiguateTypes.cmi
73 $(OCAMLC) -c -rectypes $<
74 disambiguateTypes.cmx: disambiguateTypes.ml disambiguateTypes.cmi
75 $(OCAMLOPT) -c -rectypes $<