Codebase list coq / lintian-fixes/main Makefile.docgram
lintian-fixes/main

Tree @lintian-fixes/main (Download .tar.gz)

Makefile.docgram @lintian-fixes/mainraw · history · blame

######################################################################
# 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_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/ssr/ssrparser.mlg  plugins/ssr/ssrvernac.mlg \
	plugins/ssrmatching/g_ssrmatching.mlg \
	plugins/syntax/g_number_string.mlg \
	plugins/ltac2/g_ltac2.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)
ifneq ($(sort $(DOC_MLGS)),$(sort $(REAL_DOC_MLGS)))
missing_mlgs := $(filter-out $(REAL_DOC_MLGS),$(DOC_MLGS))
extra_mlgs := $(filter-out $(DOC_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 $(DOC_MLGS) $(DOC_RSTS)

doc_gram_rsts: doc/tools/docgram/updated_rsts


# For emacs:
# Local Variables:
# mode: makefile
# End: