@@ -24,6 +24,23 @@ HTML_OPTS = $(BASE_DOC_OPTS) --to=html5 --section-divs --css=rust.css \
24
24
TEX_OPTS = $(BASE_DOC_OPTS ) --to=latex
25
25
EPUB_OPTS = $(BASE_DOC_OPTS ) --to=epub
26
26
27
+ # #####################################################################
28
+ # Rust version
29
+ # #####################################################################
30
+ doc/version.md : $(MKFILE_DEPS ) $(wildcard $(S ) doc/* .* )
31
+ @$(call E, version-stamp: $@ )
32
+ $(Q ) echo " $( CFG_VERSION) " > $@
33
+
34
+ HTML_DEPS += doc/version_info.html
35
+ doc/version_info.html : version_info.html.template $(MKFILE_DEPS ) \
36
+ $(wildcard $(S)doc/*.*)
37
+ @$(call E, version-info: $@)
38
+ sed -e "s/VERSION/$(CFG_RELEASE)/; s/SHORT_HASH/$(shell echo \
39
+ $(CFG_VER_HASH) | head -c 8)/;\
40
+ s/STAMP/$(CFG_VER_HASH)/;" $< >$@
41
+
42
+ GENERATED += doc/version.md doc/version_info.html
43
+
27
44
# #####################################################################
28
45
# Docs, from pandoc, rustdoc (which runs pandoc), and node
29
46
# #####################################################################
55
72
ifneq ($(NO_DOCS ) ,1)
56
73
57
74
DOCS += doc/rust.html
58
- doc/rust.html : rust.md doc/version_info.html doc/ full-toc.inc $(HTML_DEPS )
75
+ doc/rust.html : rust.md doc/full-toc.inc $(HTML_DEPS )
59
76
@$(call E, pandoc: $@ )
60
77
$(Q )$(CFG_NODE ) $(S ) doc/prep.js --highlight $< | \
61
78
$(CFG_PANDOC ) $(HTML_OPTS ) --include-in-header=doc/full-toc.inc --output=$@
@@ -73,19 +90,19 @@ doc/rust.epub: rust.md doc/version_info.html doc/rust.css
73
90
$(CFG_PANDOC ) $(EPUB_OPTS ) --output=$@
74
91
75
92
DOCS += doc/rustpkg.html
76
- doc/rustpkg.html : rustpkg.md doc/version_info.html $(HTML_DEPS )
93
+ doc/rustpkg.html : rustpkg.md $(HTML_DEPS )
77
94
@$(call E, pandoc: $@ )
78
95
$(Q )$(CFG_NODE ) $(S ) doc/prep.js --highlight $< | \
79
96
$(CFG_PANDOC ) $(HTML_OPTS ) --output=$@
80
97
81
98
DOCS += doc/rustdoc.html
82
- doc/rustdoc.html : rustdoc.md doc/version_info.html $(HTML_DEPS )
99
+ doc/rustdoc.html : rustdoc.md $(HTML_DEPS )
83
100
@$(call E, pandoc: $@ )
84
101
$(Q )$(CFG_NODE ) $(S ) doc/prep.js --highlight $< | \
85
102
$(CFG_PANDOC ) $(HTML_OPTS ) --output=$@
86
103
87
104
DOCS += doc/tutorial.html
88
- doc/tutorial.html : tutorial.md doc/version_info.html $(HTML_DEPS )
105
+ doc/tutorial.html : tutorial.md $(HTML_DEPS )
89
106
@$(call E, pandoc: $@ )
90
107
$(Q )$(CFG_NODE ) $(S ) doc/prep.js --highlight $< | \
91
108
$(CFG_PANDOC ) $(HTML_OPTS ) --output=$@
@@ -154,57 +171,49 @@ doc/complement-bugreport.html: $(S)doc/complement-bugreport.md $(HTML_DEPS)
154
171
# Guides
155
172
156
173
DOCS += doc/guide-macros.html
157
- doc/guide-macros.html : $(S ) doc/guide-macros.md doc/version_info.html doc/rust.css \
158
- doc/favicon.inc
174
+ doc/guide-macros.html : $(S ) doc/guide-macros.md $(HTML_DEPS )
159
175
@$(call E, pandoc: $@ )
160
176
$(Q )$(CFG_NODE ) $(S ) doc/prep.js --highlight $< | \
161
177
$(CFG_PANDOC ) $(HTML_OPTS ) --output=$@
162
178
163
179
DOCS += doc/guide-container.html
164
- doc/guide-container.html : $(S ) doc/guide-container.md doc/version_info.html doc/rust.css \
165
- doc/favicon.inc
180
+ doc/guide-container.html : $(S ) doc/guide-container.md $(HTML_DEPS )
166
181
@$(call E, pandoc: $@ )
167
182
$(Q )$(CFG_NODE ) $(S ) doc/prep.js --highlight $< | \
168
183
$(CFG_PANDOC ) $(HTML_OPTS ) --output=$@
169
184
170
185
DOCS += doc/guide-ffi.html
171
- doc/guide-ffi.html : $(S ) doc/guide-ffi.md doc/version_info.html doc/rust.css \
172
- doc/favicon.inc
186
+ doc/guide-ffi.html : $(S ) doc/guide-ffi.md $(HTML_DEPS )
173
187
@$(call E, pandoc: $@ )
174
188
$(Q )$(CFG_NODE ) $(S ) doc/prep.js --highlight $< | \
175
189
$(CFG_PANDOC ) $(HTML_OPTS ) --output=$@
176
190
177
191
DOCS += doc/guide-testing.html
178
- doc/guide-testing.html : $(S ) doc/guide-testing.md doc/version_info.html doc/rust.css \
179
- doc/favicon.inc
192
+ doc/guide-testing.html : $(S ) doc/guide-testing.md $(HTML_DEPS )
180
193
@$(call E, pandoc: $@ )
181
194
$(Q )$(CFG_NODE ) $(S ) doc/prep.js --highlight $< | \
182
195
$(CFG_PANDOC ) $(HTML_OPTS ) --output=$@
183
196
184
197
DOCS += doc/guide-borrowed-ptr.html
185
- doc/guide-borrowed-ptr.html : $(S ) doc/guide-borrowed-ptr.md doc/version_info.html doc/rust.css \
186
- doc/favicon.inc
198
+ doc/guide-borrowed-ptr.html : $(S ) doc/guide-borrowed-ptr.md $(HTML_DEPS )
187
199
@$(call E, pandoc: $@ )
188
200
$(Q )$(CFG_NODE ) $(S ) doc/prep.js --highlight $< | \
189
201
$(CFG_PANDOC ) $(HTML_OPTS ) --output=$@
190
202
191
203
DOCS += doc/guide-tasks.html
192
- doc/guide-tasks.html : $(S ) doc/guide-tasks.md doc/version_info.html doc/rust.css \
193
- doc/favicon.inc
204
+ doc/guide-tasks.html : $(S ) doc/guide-tasks.md $(HTML_DEPS )
194
205
@$(call E, pandoc: $@ )
195
206
$(Q )$(CFG_NODE ) $(S ) doc/prep.js --highlight $< | \
196
207
$(CFG_PANDOC ) $(HTML_OPTS ) --output=$@
197
208
198
209
DOCS += doc/guide-conditions.html
199
- doc/guide-conditions.html : $(S ) doc/guide-conditions.md doc/version_info.html doc/rust.css \
200
- doc/favicon.inc
210
+ doc/guide-conditions.html : $(S ) doc/guide-conditions.md $(HTML_DEPS )
201
211
@$(call E, pandoc: $@ )
202
212
$(Q )$(CFG_NODE ) $(S ) doc/prep.js --highlight $< | \
203
213
$(CFG_PANDOC ) $(HTML_OPTS ) --output=$@
204
214
205
215
DOCS += doc/guide-rustpkg.html
206
- doc/guide-rustpkg.html : $(S ) doc/guide-rustpkg.md doc/version_info.html doc/rust.css \
207
- doc/favicon.inc
216
+ doc/guide-rustpkg.html : $(S ) doc/guide-rustpkg.md $(HTML_DEPS )
208
217
@$(call E, pandoc: $@ )
209
218
$(Q )$(CFG_NODE ) $(S ) doc/prep.js --highlight $< | \
210
219
$(CFG_PANDOC ) $(HTML_OPTS ) --output=$@
@@ -303,20 +312,6 @@ ifdef CFG_DISABLE_DOCS
303
312
DOCS :=
304
313
endif
305
314
306
-
307
- doc/version.md : $(MKFILE_DEPS ) $(wildcard $(S ) doc/* .* )
308
- @$(call E, version-stamp: $@ )
309
- $(Q ) echo " $( CFG_VERSION) " > $@
310
-
311
- doc/version_info.html : version_info.html.template $(MKFILE_DEPS ) \
312
- $(wildcard $(S)doc/*.*)
313
- @$(call E, version-info: $@)
314
- sed -e "s/VERSION/$(CFG_RELEASE)/; s/SHORT_HASH/$(shell echo \
315
- $(CFG_VER_HASH) | head -c 8)/;\
316
- s/STAMP/$(CFG_VER_HASH)/;" $< >$@
317
-
318
- GENERATED += doc/version.md doc/version_info.html
319
-
320
315
docs : $(DOCS )
321
316
compiler-docs : $(CDOCS )
322
317
0 commit comments