Skip to content
Snippets Groups Projects
Commit 202c24b0 authored by Philip Kaluđerčić's avatar Philip Kaluđerčić :u7121: Committed by Max Ole Elliger
Browse files

Sort entries in the TOC by dependencies

We inject a custom order of VFILES (vernacular files) when deferring
the invocation the "html" PHONY-target in the generated Coq Makefile,
that is ordered using the output of the "coqdep" utility.  This
ensures that the partial order induced by Require is respected in the
output of "toc.html", up to topological sorting.
parent ad907b4a
No related branches found
Tags comoproj-v2.3.0
No related merge requests found
Pipeline #129281 passed
......@@ -11,8 +11,23 @@ all: coq html
coq: Makefile.coq
$(MAKE) -f Makefile.coq all
define GENCoqDoc
BEGIN { RS="[[:space:]]"; FS=":" } \
{ \
dirname = $$1; \
cmd = "coqdep -f _CoqProject -sort " dirname; \
while ((cmd | getline) > 0) { \
if ($$0 ~ "^" dirname && !seen[$$0]) { \
print $$0; \
seen[$$0] = 1; \
} \
} \
close(cmd); \
}
endef
html: Makefile.coq
$(MAKE) -f Makefile.coq html
VFILES="$(shell echo $(COMPONENTS) | awk '$(GENCoqDoc)')" $(MAKE) -e -f Makefile.coq html
Makefile.coq: _CoqProject
coq_makefile -f $< -o $@ COQDOCEXTRAFLAGS = "--lib-name $(PROJNAME)"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment