Skip to content

Commit 7f67637

Browse files
committed
[spec] Handle generated files more cleanly
1 parent 55333ae commit 7f67637

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

document/core/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
_build
22
_static
33
document/*.pyc
4-
appendix/index-instructions.rst

document/core/Makefile

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,14 @@ bikeshed-keep:
8989
echo Downloaded Bikeshed.
9090

9191

92-
.PHONY: index
93-
index:
94-
(cd appendix; ./index-instructions.py)
92+
GENERATED = appendix/index-instructions.rst
93+
.INTERMEDIATE: $(GENERATED)
94+
95+
%.rst: %.py
96+
(cd `dirname $@`; ./`basename $^`)
9597

9698
.PHONY: pdf
97-
pdf: index latexpdf
99+
pdf: $(GENERATED) latexpdf
98100
mkdir -p $(BUILDDIR)/html/$(DOWNLOADDIR)
99101
ln -f $(BUILDDIR)/latex/$(NAME).pdf $(BUILDDIR)/html/$(DOWNLOADDIR)/$(NAME).pdf
100102

@@ -103,10 +105,9 @@ pdf: index latexpdf
103105
clean:
104106
rm -rf $(BUILDDIR)
105107
rm -rf $(STATICDIR)
106-
rm -f appendix/index-instructions.rst
107108

108109
.PHONY: html
109-
html: index
110+
html: $(GENERATED)
110111
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
111112
for file in `ls $(BUILDDIR)/html/*.html`; \
112113
do \
@@ -122,19 +123,19 @@ html: index
122123
@echo "Build finished. The HTML pages are in `pwd`/$(BUILDDIR)/html/."
123124

124125
.PHONY: dirhtml
125-
dirhtml:
126+
dirhtml: $(GENERATED)
126127
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
127128
@echo
128129
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
129130

130131
.PHONY: singlehtml
131-
singlehtml:
132+
singlehtml: $(GENERATED)
132133
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
133134
@echo
134135
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
135136

136137
.PHONY: bikeshed
137-
bikeshed:
138+
bikeshed: $(GENERATED)
138139
$(SPHINXBUILD) -b singlehtml -c util/bikeshed \
139140
$(ALLSPHINXOPTS) $(BUILDDIR)/bikeshed_singlehtml
140141
python util/bikeshed_fixup.py $(BUILDDIR)/bikeshed_singlehtml/index.html \

0 commit comments

Comments
 (0)