Skip to content

Commit

Permalink
[spec] Handle generated files more cleanly
Browse files Browse the repository at this point in the history
  • Loading branch information
rossberg committed Mar 1, 2023
1 parent 55333ae commit 7f67637
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
1 change: 0 additions & 1 deletion document/core/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
_build
_static
document/*.pyc
appendix/index-instructions.rst
19 changes: 10 additions & 9 deletions document/core/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,14 @@ bikeshed-keep:
echo Downloaded Bikeshed.


.PHONY: index
index:
(cd appendix; ./index-instructions.py)
GENERATED = appendix/index-instructions.rst
.INTERMEDIATE: $(GENERATED)

%.rst: %.py
(cd `dirname $@`; ./`basename $^`)

.PHONY: pdf
pdf: index latexpdf
pdf: $(GENERATED) latexpdf
mkdir -p $(BUILDDIR)/html/$(DOWNLOADDIR)
ln -f $(BUILDDIR)/latex/$(NAME).pdf $(BUILDDIR)/html/$(DOWNLOADDIR)/$(NAME).pdf

Expand All @@ -103,10 +105,9 @@ pdf: index latexpdf
clean:
rm -rf $(BUILDDIR)
rm -rf $(STATICDIR)
rm -f appendix/index-instructions.rst

.PHONY: html
html: index
html: $(GENERATED)
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
for file in `ls $(BUILDDIR)/html/*.html`; \
do \
Expand All @@ -122,19 +123,19 @@ html: index
@echo "Build finished. The HTML pages are in `pwd`/$(BUILDDIR)/html/."

.PHONY: dirhtml
dirhtml:
dirhtml: $(GENERATED)
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."

.PHONY: singlehtml
singlehtml:
singlehtml: $(GENERATED)
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."

.PHONY: bikeshed
bikeshed:
bikeshed: $(GENERATED)
$(SPHINXBUILD) -b singlehtml -c util/bikeshed \
$(ALLSPHINXOPTS) $(BUILDDIR)/bikeshed_singlehtml
python util/bikeshed_fixup.py $(BUILDDIR)/bikeshed_singlehtml/index.html \
Expand Down

0 comments on commit 7f67637

Please sign in to comment.