15
15
DOCS :=
16
16
CDOCS :=
17
17
DOCS_L10N :=
18
- HTML_DEPS :=
18
+ HTML_DEPS := doc/
19
19
20
20
BASE_DOC_OPTS := --standalone --toc --number-sections
21
21
HTML_OPTS = $(BASE_DOC_OPTS ) --to=html5 --section-divs --css=rust.css \
22
22
--include-before-body=doc/version_info.html --include-in-header=doc/favicon.inc
23
23
TEX_OPTS = $(BASE_DOC_OPTS ) --include-before-body=doc/version.md --to=latex
24
24
EPUB_OPTS = $(BASE_DOC_OPTS ) --to=epub
25
25
26
+ D := $(S ) src/doc
27
+
26
28
# #####################################################################
27
29
# Rust version
28
30
# #####################################################################
29
31
30
- doc/version.md : $(MKFILE_DEPS ) $(wildcard $(S ) doc /* .* )
32
+ doc/version.md : $(MKFILE_DEPS ) $(wildcard $(D ) /* .* ) | doc/
31
33
@$(call E, version-stamp: $@ )
32
34
$(Q ) echo " $( CFG_VERSION) " > $@
33
35
34
36
HTML_DEPS += doc/version_info.html
35
- doc/version_info.html : version_info.html.template $(MKFILE_DEPS ) \
36
- $(wildcard $(S)doc /*.*)
37
+ doc/version_info.html : $( D ) / version_info.html.template $(MKFILE_DEPS ) \
38
+ $(wildcard $(D) /*.*) | doc/
37
39
@$(call E, version-info: $@)
38
40
sed -e "s/VERSION/$(CFG_RELEASE)/; s/SHORT_HASH/$(shell echo \
39
41
$(CFG_VER_HASH) | head -c 8)/;\
@@ -45,17 +47,20 @@ GENERATED += doc/version.md doc/version_info.html
45
47
# Docs, from pandoc, rustdoc (which runs pandoc), and node
46
48
# #####################################################################
47
49
50
+ doc/ :
51
+ @mkdir -p $@
52
+
48
53
HTML_DEPS += doc/rust.css
49
- doc/rust.css : rust.css
54
+ doc/rust.css : $( D ) / rust.css | doc/
50
55
@$(call E, cp: $@ )
51
56
$(Q ) cp -a $< $@ 2> /dev/null
52
57
53
- doc/full-toc.inc : full-toc.inc
58
+ doc/full-toc.inc : $( D ) / full-toc.inc | doc/
54
59
@$(call E, cp: $@ )
55
60
$(Q ) cp -a $< $@ 2> /dev/null
56
61
57
62
HTML_DEPS += doc/favicon.inc
58
- doc/favicon.inc : favicon.inc
63
+ doc/favicon.inc : $( D ) / favicon.inc | doc/
59
64
@$(call E, cp: $@ )
60
65
$(Q ) cp -a $< $@ 2> /dev/null
61
66
@@ -72,52 +77,52 @@ endif
72
77
ifneq ($(NO_DOCS ) ,1)
73
78
74
79
DOCS += doc/rust.html
75
- doc/rust.html : rust.md doc/full-toc.inc $(HTML_DEPS )
80
+ doc/rust.html : $( D ) / rust.md doc/full-toc.inc $(HTML_DEPS ) | doc/
76
81
@$(call E, pandoc: $@ )
77
- $(Q )$(CFG_NODE ) $(S ) doc /prep.js --highlight $< | \
82
+ $(Q )$(CFG_NODE ) $(D ) /prep.js --highlight $< | \
78
83
$(CFG_PANDOC ) $(HTML_OPTS ) --include-in-header=doc/full-toc.inc --output=$@
79
84
80
85
DOCS += doc/rust.tex
81
- doc/rust.tex : rust.md doc/version.md
86
+ doc/rust.tex : $( D ) / rust.md doc/version.md | doc/
82
87
@$(call E, pandoc: $@ )
83
- $(Q )$(CFG_NODE ) $(S ) doc /prep.js $< | \
88
+ $(Q )$(CFG_NODE ) $(D ) /prep.js $< | \
84
89
$(CFG_PANDOC ) $(TEX_OPTS ) --output=$@
85
90
86
91
DOCS += doc/rust.epub
87
- doc/rust.epub : rust.md
92
+ doc/rust.epub : $( D ) / rust.md | doc/
88
93
@$(call E, pandoc: $@ )
89
- $(Q )$(CFG_NODE ) $(S ) doc /prep.js --highlight $< | \
94
+ $(Q )$(CFG_NODE ) $(D ) /prep.js --highlight $< | \
90
95
$(CFG_PANDOC ) $(EPUB_OPTS ) --output=$@
91
96
92
97
DOCS += doc/rustdoc.html
93
- doc/rustdoc.html : rustdoc.md $(HTML_DEPS )
98
+ doc/rustdoc.html : $( D ) / rustdoc.md $(HTML_DEPS )
94
99
@$(call E, pandoc: $@ )
95
- $(Q )$(CFG_NODE ) $(S ) doc /prep.js --highlight $< | \
100
+ $(Q )$(CFG_NODE ) $(D ) /prep.js --highlight $< | \
96
101
$(CFG_PANDOC ) $(HTML_OPTS ) --output=$@
97
102
98
103
DOCS += doc/tutorial.html
99
- doc/tutorial.html : tutorial.md $(HTML_DEPS )
104
+ doc/tutorial.html : $( D ) / tutorial.md $(HTML_DEPS )
100
105
@$(call E, pandoc: $@ )
101
- $(Q )$(CFG_NODE ) $(S ) doc /prep.js --highlight $< | \
106
+ $(Q )$(CFG_NODE ) $(D ) /prep.js --highlight $< | \
102
107
$(CFG_PANDOC ) $(HTML_OPTS ) --output=$@
103
108
104
109
DOCS += doc/tutorial.tex
105
- doc/tutorial.tex : tutorial.md doc/version.md
110
+ doc/tutorial.tex : $( D ) / tutorial.md doc/version.md
106
111
@$(call E, pandoc: $@ )
107
- $(Q )$(CFG_NODE ) $(S ) doc /prep.js $< | \
112
+ $(Q )$(CFG_NODE ) $(D ) /prep.js $< | \
108
113
$(CFG_PANDOC ) $(TEX_OPTS ) --output=$@
109
114
110
115
DOCS += doc/tutorial.epub
111
- doc/tutorial.epub : tutorial.md
116
+ doc/tutorial.epub : $( D ) / tutorial.md
112
117
@$(call E, pandoc: $@ )
113
- $(Q )$(CFG_NODE ) $(S ) doc /prep.js --highlight $< | \
118
+ $(Q )$(CFG_NODE ) $(D ) /prep.js --highlight $< | \
114
119
$(CFG_PANDOC ) $(EPUB_OPTS ) --output=$@
115
120
116
121
117
122
DOCS_L10N += doc/l10n/ja/tutorial.html
118
123
doc/l10n/ja/tutorial.html : doc/l10n/ja/tutorial.md doc/version_info.html doc/rust.css
119
124
@$(call E, pandoc: $@ )
120
- $(Q )$(CFG_NODE ) $(S ) doc /prep.js --highlight doc/l10n/ja/tutorial.md | \
125
+ $(Q )$(CFG_NODE ) $(D ) /prep.js --highlight doc/l10n/ja/tutorial.md | \
121
126
$(CFG_PANDOC) --standalone --toc \
122
127
--section-divs --number-sections \
123
128
--from =markdown --to=html5 --css=../../rust.css \
@@ -127,95 +132,95 @@ doc/l10n/ja/tutorial.html: doc/l10n/ja/tutorial.md doc/version_info.html doc/rus
127
132
# Complementary documentation
128
133
#
129
134
DOCS += doc/index.html
130
- doc/index.html : index.md $(HTML_DEPS )
135
+ doc/index.html : $( D ) / index.md $(HTML_DEPS )
131
136
@$(call E, pandoc: $@ )
132
- $(Q )$(CFG_NODE ) $(S ) doc /prep.js --highlight $< | \
137
+ $(Q )$(CFG_NODE ) $(D ) /prep.js --highlight $< | \
133
138
$(CFG_PANDOC ) $(HTML_OPTS ) --output=$@
134
139
135
140
DOCS += doc/complement-lang-faq.html
136
- doc/complement-lang-faq.html : $(S ) doc /complement-lang-faq.md doc/full-toc.inc $(HTML_DEPS )
141
+ doc/complement-lang-faq.html : $(D ) /complement-lang-faq.md doc/full-toc.inc $(HTML_DEPS )
137
142
@$(call E, pandoc: $@ )
138
- $(Q )$(CFG_NODE ) $(S ) doc /prep.js --highlight $< | \
143
+ $(Q )$(CFG_NODE ) $(D ) /prep.js --highlight $< | \
139
144
$(CFG_PANDOC ) $(HTML_OPTS ) --include-in-header=doc/full-toc.inc --output=$@
140
145
141
146
DOCS += doc/complement-project-faq.html
142
- doc/complement-project-faq.html : $(S ) doc /complement-project-faq.md $(HTML_DEPS )
147
+ doc/complement-project-faq.html : $(D ) /complement-project-faq.md $(HTML_DEPS )
143
148
@$(call E, pandoc: $@ )
144
- $(Q )$(CFG_NODE ) $(S ) doc /prep.js --highlight $< | \
149
+ $(Q )$(CFG_NODE ) $(D ) /prep.js --highlight $< | \
145
150
$(CFG_PANDOC ) $(HTML_OPTS ) --output=$@
146
151
147
152
DOCS += doc/complement-usage-faq.html
148
- doc/complement-usage-faq.html : $(S ) doc /complement-usage-faq.md $(HTML_DEPS )
153
+ doc/complement-usage-faq.html : $(D ) /complement-usage-faq.md $(HTML_DEPS )
149
154
@$(call E, pandoc: $@ )
150
- $(Q )$(CFG_NODE ) $(S ) doc /prep.js --highlight $< | \
155
+ $(Q )$(CFG_NODE ) $(D ) /prep.js --highlight $< | \
151
156
$(CFG_PANDOC ) $(HTML_OPTS ) --output=$@
152
157
153
158
DOCS += doc/complement-cheatsheet.html
154
- doc/complement-cheatsheet.html : $(S ) doc /complement-cheatsheet.md doc/full-toc.inc $(HTML_DEPS )
159
+ doc/complement-cheatsheet.html : $(D ) /complement-cheatsheet.md doc/full-toc.inc $(HTML_DEPS )
155
160
@$(call E, pandoc: $@ )
156
- $(Q )$(CFG_NODE ) $(S ) doc /prep.js --highlight $< | \
161
+ $(Q )$(CFG_NODE ) $(D ) /prep.js --highlight $< | \
157
162
$(CFG_PANDOC ) $(HTML_OPTS ) --include-in-header=doc/full-toc.inc --output=$@
158
163
159
164
DOCS += doc/complement-bugreport.html
160
- doc/complement-bugreport.html : $(S ) doc /complement-bugreport.md $(HTML_DEPS )
165
+ doc/complement-bugreport.html : $(D ) /complement-bugreport.md $(HTML_DEPS )
161
166
@$(call E, pandoc: $@ )
162
- $(Q )$(CFG_NODE ) $(S ) doc /prep.js --highlight $< | \
167
+ $(Q )$(CFG_NODE ) $(D ) /prep.js --highlight $< | \
163
168
$(CFG_PANDOC ) $(HTML_OPTS ) --output=$@
164
169
165
170
# Guides
166
171
167
172
DOCS += doc/guide-macros.html
168
- doc/guide-macros.html : $(S ) doc /guide-macros.md $(HTML_DEPS )
173
+ doc/guide-macros.html : $(D ) /guide-macros.md $(HTML_DEPS )
169
174
@$(call E, pandoc: $@ )
170
- $(Q )$(CFG_NODE ) $(S ) doc /prep.js --highlight $< | \
175
+ $(Q )$(CFG_NODE ) $(D ) /prep.js --highlight $< | \
171
176
$(CFG_PANDOC ) $(HTML_OPTS ) --output=$@
172
177
173
178
DOCS += doc/guide-container.html
174
- doc/guide-container.html : $(S ) doc /guide-container.md $(HTML_DEPS )
179
+ doc/guide-container.html : $(D ) /guide-container.md $(HTML_DEPS )
175
180
@$(call E, pandoc: $@ )
176
- $(Q )$(CFG_NODE ) $(S ) doc /prep.js --highlight $< | \
181
+ $(Q )$(CFG_NODE ) $(D ) /prep.js --highlight $< | \
177
182
$(CFG_PANDOC ) $(HTML_OPTS ) --output=$@
178
183
179
184
DOCS += doc/guide-ffi.html
180
- doc/guide-ffi.html : $(S ) doc /guide-ffi.md $(HTML_DEPS )
185
+ doc/guide-ffi.html : $(D ) /guide-ffi.md $(HTML_DEPS )
181
186
@$(call E, pandoc: $@ )
182
- $(Q )$(CFG_NODE ) $(S ) doc /prep.js --highlight $< | \
187
+ $(Q )$(CFG_NODE ) $(D ) /prep.js --highlight $< | \
183
188
$(CFG_PANDOC ) $(HTML_OPTS ) --output=$@
184
189
185
190
DOCS += doc/guide-testing.html
186
- doc/guide-testing.html : $(S ) doc /guide-testing.md $(HTML_DEPS )
191
+ doc/guide-testing.html : $(D ) /guide-testing.md $(HTML_DEPS )
187
192
@$(call E, pandoc: $@ )
188
- $(Q )$(CFG_NODE ) $(S ) doc /prep.js --highlight $< | \
193
+ $(Q )$(CFG_NODE ) $(D ) /prep.js --highlight $< | \
189
194
$(CFG_PANDOC ) $(HTML_OPTS ) --output=$@
190
195
191
196
DOCS += doc/guide-lifetimes.html
192
- doc/guide-lifetimes.html : $(S ) doc /guide-lifetimes.md $(HTML_DEPS )
197
+ doc/guide-lifetimes.html : $(D ) /guide-lifetimes.md $(HTML_DEPS )
193
198
@$(call E, pandoc: $@ )
194
- $(Q )$(CFG_NODE ) $(S ) doc /prep.js --highlight $< | \
199
+ $(Q )$(CFG_NODE ) $(D ) /prep.js --highlight $< | \
195
200
$(CFG_PANDOC ) $(HTML_OPTS ) --output=$@
196
201
197
202
DOCS += doc/guide-tasks.html
198
- doc/guide-tasks.html : $(S ) doc /guide-tasks.md $(HTML_DEPS )
203
+ doc/guide-tasks.html : $(D ) /guide-tasks.md $(HTML_DEPS )
199
204
@$(call E, pandoc: $@ )
200
- $(Q )$(CFG_NODE ) $(S ) doc /prep.js --highlight $< | \
205
+ $(Q )$(CFG_NODE ) $(D ) /prep.js --highlight $< | \
201
206
$(CFG_PANDOC ) $(HTML_OPTS ) --output=$@
202
207
203
208
DOCS += doc/guide-conditions.html
204
- doc/guide-conditions.html : $(S ) doc /guide-conditions.md $(HTML_DEPS )
209
+ doc/guide-conditions.html : $(D ) /guide-conditions.md $(HTML_DEPS )
205
210
@$(call E, pandoc: $@ )
206
- $(Q )$(CFG_NODE ) $(S ) doc /prep.js --highlight $< | \
211
+ $(Q )$(CFG_NODE ) $(D ) /prep.js --highlight $< | \
207
212
$(CFG_PANDOC ) $(HTML_OPTS ) --output=$@
208
213
209
214
DOCS += doc/guide-pointers.html
210
- doc/guide-pointers.html : $(S ) doc /guide-pointers.md $(HTML_DEPS )
215
+ doc/guide-pointers.html : $(D ) /guide-pointers.md $(HTML_DEPS )
211
216
@$(call E, pandoc: $@ )
212
- $(Q )$(CFG_NODE ) $(S ) doc /prep.js --highlight $< | \
217
+ $(Q )$(CFG_NODE ) $(D ) /prep.js --highlight $< | \
213
218
$(CFG_PANDOC ) $(HTML_OPTS ) --output=$@
214
219
215
220
DOCS += doc/guide-runtime.html
216
- doc/guide-runtime.html : $(S ) doc /guide-runtime.md $(HTML_DEPS )
221
+ doc/guide-runtime.html : $(D ) /guide-runtime.md $(HTML_DEPS )
217
222
@$(call E, pandoc: $@ )
218
- $(Q )$(CFG_NODE ) $(S ) doc /prep.js --highlight $< | \
223
+ $(Q )$(CFG_NODE ) $(D ) /prep.js --highlight $< | \
219
224
$(CFG_PANDOC ) $(HTML_OPTS ) --output=$@
220
225
221
226
ifeq ($(CFG_PDFLATEX),)
@@ -274,8 +279,10 @@ endif
274
279
# Rustdoc (libstd/extra)
275
280
# #####################################################################
276
281
277
- # The rustdoc executable
278
- RUSTDOC = $(HBIN2_H_$(CFG_BUILD ) ) /rustdoc$(X_$(CFG_BUILD ) )
282
+ # The rustdoc executable, rpath included in case --disable-rpath was provided to
283
+ # ./configure
284
+ RUSTDOC = $(RPATH_VAR2_T_$(CFG_BUILD ) _H_$(CFG_BUILD ) ) \
285
+ $(HBIN2_H_$(CFG_BUILD ) ) /rustdoc$(X_$(CFG_BUILD ) )
279
286
280
287
# The library documenting macro
281
288
#
0 commit comments