2 PACKAGE = cic_textual_parser2
3 REQUIRES = ulex pxp helm-tactics helm-logger helm-cic_unification camlp4.gramlib
4 NOTATIONS = logic arit tex
6 disambiguateTypes.mli \
7 disambiguateChoices.mli \
8 cicTextualParser2Pp.mli \
10 cicTextualLexer2.mli \
11 cicTextualParser2.mli \
13 IMPLEMENTATION_FILES = \
14 $(patsubst %.mli, %.ml, $(INTERFACE_FILES)) \
15 $(patsubst %,%_notation.ml,$(NOTATIONS))
17 ULEXDIR := $(shell ocamlfind query ulex)
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
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 $<
30 %_notation.cmo: %_notation.ml cicTextualParser2.cmo
31 $(OCAMLC) -pp "camlp4o $(PARSER_P4_OPTS)" -c $<
33 pa_unicode_macro.cmo: pa_unicode_macro.ml macro.cmo
34 $(OCAMLC) -pp "camlp4o $(PA_P4_OPTS)" -c $<
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 $@ $<
45 .PHONY: macro_table.dump
46 macro_table.dump: make_table
50 distclean: extra_clean
51 rm -f macro_table.dump
53 rm -f test_lexer test_parser make_table
55 include ../Makefile.common
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
61 disambiguateTypes.cmi: disambiguateTypes.mli
62 $(OCAMLC) -c -rectypes $<
63 disambiguateTypes.cmo: disambiguateTypes.ml disambiguateTypes.cmi
64 $(OCAMLC) -c -rectypes $<