2 PACKAGE = cic_textual_parser2
3 REQUIRES = ulex camlp4 pxp
4 INTERFACE_FILES = ast.mli pp.mli macro.mli lexer.mli
6 IMPLEMENTATION_FILES = \
7 pp.ml macro.ml lexer.ml parser.ml \
8 $(patsubst %,%_notation.ml,$(NOTATIONS))
10 ULEXDIR := $(shell ocamlfind query ulex)
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
16 include ../Makefile.common
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 $<
23 %_notation.cmo: %_notation.ml parser.cmo
24 $(OCAMLC) -pp "camlp4o $(PARSER_P4_OPTS)" -c $<
26 pa_unicode_macro.cmo: pa_unicode_macro.ml macro.cmo
27 $(OCAMLC) -pp "camlp4o $(PA_P4_OPTS)" -c $<
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 $@ $<
38 .PHONY: macro_table.dump
39 macro_table.dump: make_table
43 distclean: extra_clean
44 rm -f macro_table.dump
46 rm -f test_lexer test_parser make_table