forked from JuliaLang/julia
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
83 lines (68 loc) · 2.95 KB
/
Copy pathMakefile
File metadata and controls
83 lines (68 loc) · 2.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# Makefile for building documentation
.PHONY: default
default: html
# You can set these variables from the command line.
SRCDIR := $(abspath $(dir $(lastword $(MAKEFILE_LIST))))
JULIAHOME := $(abspath $(SRCDIR)/..)
SRCCACHE := $(abspath $(JULIAHOME)/deps/srccache)
include $(JULIAHOME)/Make.inc
JULIA_EXECUTABLE := $(call spawn,$(build_bindir)/julia) --startup-file=no
.PHONY: help
help:
@echo "Please use 'make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
@echo " pdf to make standalone PDF file"
@echo
@echo "To run linkcheck, use 'make <target> linkcheck=true'"
@echo "To run doctests, use 'make <target> doctest=true'"
@echo "To fix outdated doctests, use 'make <target> doctest=fix'"
@echo "To run doctests using Revise (to test changes without rebuilding the sysimage), use 'make <target> doctest=true revise=true'"
VERSDIR := v$(shell cut -d. -f1-2 < $(JULIAHOME)/VERSION)
DOCUMENTER_OPTIONS := linkcheck=$(linkcheck) doctest=$(doctest) buildroot=$(call cygpath_w,$(BUILDROOT)) \
texplatform=$(texplatform) revise=$(revise) stdlibdir=$(call cygpath_w,$(build_datarootdir)/julia/stdlib/$(VERSDIR)/)
UNICODE_DATA_VERSION=17.0.0
$(SRCCACHE)/UnicodeData-$(UNICODE_DATA_VERSION).txt:
@mkdir -p "$(SRCCACHE)"
$(JLDOWNLOAD) "$@" https://www.unicode.org/Public/$(UNICODE_DATA_VERSION)/ucd/UnicodeData.txt
# NEWS.md and stdlib are in-tree build artifacts - don't link them for oot builds.
DOC_FILES=$(filter-out NEWS.md stdlib,$(notdir $(wildcard $(SRCDIR)/src/*)))
src/%:
@mkdir -p src
ln -s $(SRCDIR)/src/$* $@
.PHONY: src
src: $(addprefix src/,$(DOC_FILES))
.PHONY: deps
deps: $(SRCCACHE)/UnicodeData-$(UNICODE_DATA_VERSION).txt
$(JLCHECKSUM) "$<"
cp "$<" UnicodeData.txt
.PHONY: alldeps
alldeps: deps
$(JULIA_EXECUTABLE) --color=yes $(call cygpath_w,$(SRCDIR)/make.jl) deps $(DOCUMENTER_OPTIONS)
.PHONY: checksum-unicodedata
checksum-unicodedata: $(SRCCACHE)/UnicodeData-$(UNICODE_DATA_VERSION).txt
$(JLCHECKSUM) "$<"
.PHONY: clean
clean:
rm -rf _build/* deps/* docbuild.log UnicodeData.txt
.PHONY: cleanall
cleanall: clean
.PHONY: html
html: deps
@echo "Building HTML documentation."
$(JULIA_EXECUTABLE) --color=yes $(call cygpath_w,$(SRCDIR)/make.jl) $(DOCUMENTER_OPTIONS)
@echo "Build finished. The HTML pages are in _build/html."
.PHONY: pdf
pdf: deps
@echo "Building PDF documentation."
$(JULIA_EXECUTABLE) --color=yes $(call cygpath_w,$(SRCDIR)/make.jl) -- pdf $(DOCUMENTER_OPTIONS)
@echo "Build finished."
# The deploy target should only be called in CI builds
.PHONY: deploy
deploy: deps
@echo "Deploying HTML documentation."
$(JULIA_EXECUTABLE) --color=yes $(call cygpath_w,$(SRCDIR)/make.jl) -- deploy $(DOCUMENTER_OPTIONS)
@echo "Build & deploy of docs finished."
.PHONY: update-documenter
update-documenter:
@echo "Updating Documenter."
JULIA_PKG_PRECOMPILE_AUTO=0 $(JULIA_EXECUTABLE) --project=$(call cygpath_w,$(SRCDIR)/../deps/jlutilities/documenter/) --color=yes -e 'using Pkg; Pkg.update()'