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