23
23
# * dist-docs - Stage docs for upload
24
24
25
25
PKG_NAME := $(CFG_PACKAGE_NAME )
26
+ DOC_PKG_NAME := rust-docs-$(CFG_PACKAGE_VERS )
26
27
27
28
# License suitable for displaying in a popup
28
29
LICENSE.txt : $(S ) COPYRIGHT $(S ) LICENSE-APACHE $(S ) LICENSE-MIT
@@ -229,7 +230,11 @@ dist-install-dir-$(1): prepare-base-dir-$(1) docs compiler-docs
229
230
$$(Q )$$(PREPARE_MAN_CMD ) $$(S ) LICENSE-APACHE $$(PREPARE_DEST_DIR )
230
231
$$(Q )$$(PREPARE_MAN_CMD ) $$(S ) LICENSE-MIT $$(PREPARE_DEST_DIR )
231
232
$$(Q )$$(PREPARE_MAN_CMD ) $$(S ) README.md $$(PREPARE_DEST_DIR )
232
- $$(Q ) [ ! -d doc ] || cp -r doc $$(PREPARE_DEST_DIR )
233
+ $$(Q ) mkdir -p $$(PREPARE_DEST_DIR ) /share/doc/rust
234
+ $$(Q )$$(PREPARE_MAN_CMD ) $$(S ) COPYRIGHT $$(PREPARE_DEST_DIR ) /share/doc/rust
235
+ $$(Q )$$(PREPARE_MAN_CMD ) $$(S ) LICENSE-APACHE $$(PREPARE_DEST_DIR ) /share/doc/rust
236
+ $$(Q )$$(PREPARE_MAN_CMD ) $$(S ) LICENSE-MIT $$(PREPARE_DEST_DIR ) /share/doc/rust
237
+ $$(Q )$$(PREPARE_MAN_CMD ) $$(S ) README.md $$(PREPARE_DEST_DIR ) /share/doc/rust
233
238
234
239
dist/$$(PKG_NAME ) -$(1 ) .tar.gz: dist-install-dir-$(1 )
235
240
@$(call E, build: $$@ )
@@ -247,6 +252,26 @@ dist/$$(PKG_NAME)-$(1).tar.gz: dist-install-dir-$(1)
247
252
--legacy-manifest-dirs=rustlib,cargo
248
253
$$(Q ) rm -R tmp/dist/$$(PKG_NAME ) -$(1 ) -image
249
254
255
+ dist-doc-install-dir-$(1 ) : docs compiler-docs
256
+ $$(Q ) mkdir -p tmp/dist/$$(DOC_PKG_NAME ) -$(1 ) -image/share/doc/rust
257
+ $$(Q ) cp -r doc tmp/dist/$$(DOC_PKG_NAME ) -$(1 ) -image/share/doc/rust/html
258
+
259
+ dist/$$(DOC_PKG_NAME ) -$(1 ) .tar.gz: dist-doc-install-dir-$(1 )
260
+ @$(call E, build: $$@ )
261
+ $$(Q )$$(S ) src/rust-installer/gen-installer.sh \
262
+ --product-name=Rust-Documentation \
263
+ --rel-manifest-dir=rustlib \
264
+ --success-message=Rust-documentation-is-installed. \
265
+ --image-dir=tmp/dist/$$(DOC_PKG_NAME ) -$(1 ) -image \
266
+ --work-dir=tmp/dist \
267
+ --output-dir=dist \
268
+ --package-name=$$(DOC_PKG_NAME ) -$(1 ) \
269
+ --component-name=rust-docs \
270
+ --legacy-manifest-dirs=rustlib,cargo \
271
+ --bulk-dirs=share/doc/rust/html
272
+ $$(Q ) rm -R tmp/dist/$$(DOC_PKG_NAME ) -$(1 ) -image
273
+
274
+
250
275
endef
251
276
252
277
ifneq ($(CFG_ENABLE_DIST_HOST_ONLY ) ,)
@@ -259,7 +284,12 @@ endif
259
284
260
285
dist-install-dirs : $(foreach host,$(CFG_HOST ) ,dist-install-dir-$(host ) )
261
286
287
+ ifneq ($(CFG_DISABLE_DOCS ) ,)
262
288
dist-tar-bins : $(foreach host,$(CFG_HOST ) ,dist/$(PKG_NAME ) -$(host ) .tar.gz)
289
+ else
290
+ dist-tar-bins : $(foreach host,$(CFG_HOST ) ,dist/$(PKG_NAME ) -$(host ) .tar.gz) \
291
+ $(foreach host,$(CFG_HOST),dist/$(DOC_PKG_NAME)-$(host).tar.gz)
292
+ endif
263
293
264
294
# Just try to run the compiler for the build host
265
295
distcheck-tar-bins : dist-tar-bins
0 commit comments