Debian Codegraph @

doc/Makefile.docgram

raw
1 ######################################################################
2 # doc_grammar tool
3 ######################################################################
4
5 DOCGRAMWARN ?= 0
6 ifeq ($(DOCGRAMWARN),0)
7 DOCGRAMWARNFLAG=-no-warn
8 else
9 DOCGRAMWARNFLAG=
10 endif
11
12 # List mlg files explicitly to avoid ordering problems (across
13 # different installations / make versions).
14 DOC_MLGS := \
15 parsing/g_constr.mlg parsing/g_prim.mlg \
16 toplevel/g_toplevel.mlg \
17 vernac/g_proofs.mlg vernac/g_redexpr.mlg vernac/g_vernac.mlg vernac/g_obligations.mlg \
18 plugins/btauto/g_btauto.mlg \
19 plugins/cc/g_congruence.mlg \
20 plugins/derive/g_derive.mlg \
21 plugins/extraction/g_extraction.mlg \
22 plugins/firstorder/g_ground.mlg \
23 plugins/funind/g_indfun.mlg \
24 plugins/ltac/coretactics.mlg plugins/ltac/extraargs.mlg plugins/ltac/extratactics.mlg \
25 plugins/ltac/g_auto.mlg plugins/ltac/g_class.mlg plugins/ltac/g_eqdecide.mlg \
26 plugins/ltac/g_ltac.mlg plugins/ltac/g_rewrite.mlg \
27 plugins/ltac/g_tactic.mlg plugins/ltac/profile_ltac_tactics.mlg \
28 plugins/micromega/g_micromega.mlg plugins/micromega/g_zify.mlg \
29 plugins/nsatz/g_nsatz.mlg \
30 plugins/ring/g_ring.mlg \
31 plugins/rtauto/g_rtauto.mlg \
32 plugins/syntax/g_number_string.mlg \
33 plugins/ltac2/g_ltac2.mlg plugins/ltac2_ltac1/g_ltac2_ltac1.mlg
34 DOC_EDIT_MLGS := $(wildcard doc/tools/docgram/*.edit_mlg)
35 DOC_RSTS := $(wildcard doc/sphinx/*/*.rst) $(wildcard doc/sphinx/*/*/*.rst)
36
37 REAL_DOC_MLGS := $(wildcard */*.mlg plugins/*/*.mlg)
38 # omit SSR MLGS and chapter for now
39 SSR_MLGS := \
40 plugins/ssr/ssrparser.mlg plugins/ssr/ssrtacs.mlg plugins/ssr/ssrvernac.mlg \
41 plugins/ssrmatching/g_ssrmatching.mlg
42 REAL_DOC_MLGS := $(filter-out $(SSR_MLGS),$(REAL_DOC_MLGS))
43 SSR_RSTS := doc/sphinx/proof-engine/ssreflect-proof-language.rst
44 DOC_RSTS := $(filter-out $(SSR_RSTS),$(DOC_RSTS))
45
46 ifneq ($(sort $(DOC_MLGS)),$(sort $(REAL_DOC_MLGS)))
47 missing_mlgs := $(filter-out $(REAL_DOC_MLGS),$(DOC_MLGS))
48 extra_mlgs := $(filter-out $(DOC_MLGS),$(SSR_MLGS),$(REAL_DOC_MLGS))
49 $(error mlg file list mismatch in Makefile.doc: $(if $(missing_mlgs),$(missing_mlgs) not found) $(if $(extra_mlgs),$(extra_mlgs) not listed))
50 endif
51
52 doc/tools/docgram/fullGrammar: $(DOC_GRAM) $(DOC_MLGS)
53 $(SHOW)'DOC_GRAM'
54 $(HIDE)$(DOC_GRAM) -short -no-warn $(DOC_MLGS)
55
56 #todo: add a dependency of sphinx on updated_rsts when we're ready
57 doc/tools/docgram/orderedGrammar doc/tools/docgram/updated_rsts: doc/tools/docgram/fullGrammar $(DOC_GRAM) $(DOC_EDIT_MLGS)
58 $(SHOW)'DOC_GRAM_RSTS'
59 $(HIDE)$(DOC_GRAM) $(DOCGRAMWARNFLAG) -check-cmds -check-tacs $(DOC_MLGS) $(DOC_RSTS)
60
61 .PRECIOUS: doc/tools/docgram/orderedGrammar
62
63 doc/tools/docgram/updated_rsts: doc/tools/docgram/orderedGrammar
64
65 .PHONY: doc_gram doc_gram_verify doc_gram_rsts
66
67 doc_gram: doc/tools/docgram/fullGrammar
68
69 doc_gram_verify: $(DOC_GRAM) $(DOC_MLGS)
70 $(SHOW)'DOC_GRAM_VERIFY'
71 $(HIDE)$(DOC_GRAM) -no-warn -verify -check-cmds -check-tacs $(DOC_MLGS) $(DOC_RSTS)
72
73 doc_gram_rsts: doc/tools/docgram/updated_rsts
74
75
76 # For emacs:
77 # Local Variables:
78 # mode: makefile
79 # End: