aboutsummaryrefslogtreecommitdiff
path: root/Makefile.doc
diff options
context:
space:
mode:
authorThéo Zimmermann2019-11-21 17:39:41 +0100
committerThéo Zimmermann2019-11-21 17:39:41 +0100
commita876df3f1e9a495ee04c78321adf83a31ede7f3c (patch)
treeda75e474f97b2434bc39fd877830b33c75982537 /Makefile.doc
parentc0f34539209842735ccb93f3c069632b7eee4d6c (diff)
parentb4eca882b6692b6374dfff8517f9f5a5cc4970f5 (diff)
Merge PR #10614: Update the Gallina grammar in doc, "Terms" section
Ack-by: Zimmi48
Diffstat (limited to 'Makefile.doc')
-rw-r--r--Makefile.doc39
1 files changed, 39 insertions, 0 deletions
diff --git a/Makefile.doc b/Makefile.doc
index 041f26f0b4..8e958532f0 100644
--- a/Makefile.doc
+++ b/Makefile.doc
@@ -227,6 +227,45 @@ install-doc-sphinx:
$(INSTALLLIB) doc/sphinx/_build/$$d/$$f $(FULLDOCDIR)/sphinx/$$d/$$f;\
done; done)
+######################################################################
+# doc_grammar tool
+######################################################################
+
+DOC_GRAMCMO := $(addsuffix .cmo, $(addprefix coqpp/, coqpp_parse coqpp_lex))
+
+$(DOC_GRAM): $(DOC_GRAMCMO) coqpp/coqpp_parser.mli coqpp/coqpp_parser.ml doc/tools/docgram/doc_grammar.ml
+ $(SHOW)'OCAMLC -a $@'
+ $(HIDE)$(OCAMLC) -I coqpp $^ -package str -linkall -linkpkg -o $@
+
+# user-contrib/*/*.mlg omitted for now (e.g. ltac2)
+PLUGIN_MLGS := $(wildcard plugins/*/*.mlg)
+OMITTED_PLUGIN_MLGS := plugins/ssr/ssrparser.mlg plugins/ssr/ssrvernac.mlg plugins/ssrmatching/g_ssrmatching.mlg
+DOC_MLGS := */*.mlg $(sort $(filter-out $(OMITTED_PLUGIN_MLGS), $(PLUGIN_MLGS)))
+DOC_EDIT_MLGS := doc/tools/docgram/*.edit_mlg
+DOC_RSTS := doc/sphinx/*.rst doc/sphinx/*/*.rst
+
+doc/tools/docgram/fullGrammar: $(DOC_GRAM) $(DOC_MLGS)
+ $(SHOW)'DOC_GRAM'
+ $(HIDE)$(DOC_GRAM) -short -no-warn $(DOC_MLGS)
+
+#todo: add a dependency of sphinx on updated_rsts when we're ready
+doc/tools/docgram/orderedGrammar doc/tools/docgram/updated_rsts: $(DOC_GRAM) $(DOC_EDIT_MLGS)
+ $(SHOW)'DOC_GRAM_RSTS'
+ $(HIDE)$(DOC_GRAM) $(DOC_MLGS) $(DOC_RSTS)
+
+doc/tools/docgram/updated_rsts: doc/tools/docgram/orderedGrammar
+
+.PHONY: doc_gram doc_gram_verify doc_gram_rsts
+
+doc_gram: doc/tools/docgram/fullGrammar
+
+doc_gram_verify: doc/tools/docgram/fullGrammar
+ $(SHOW)'DOC_GRAM_VERIFY'
+ $(HIDE)$(DOC_GRAM) -short -no-warn -verify $(DOC_MLGS) $(DOC_RSTS)
+
+doc_gram_rsts: doc/tools/docgram/updated_rsts
+
+
# For emacs:
# Local Variables:
# mode: makefile