forked from sagemath/sage-archive-2023-02-01
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
173 lines (134 loc) · 4.52 KB
/
Makefile
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# Main Makefile for Sage.
# The default target ("all") builds Sage and the whole (HTML) documentation.
#
# Target "build" just builds Sage.
#
# See below for targets to build the documentation in other formats,
# to run various types of test suites, and to remove parts of the build etc.
PIPE = spkg/pipestatus
all: start doc # indirectly depends on build
logs:
mkdir -p $@
build: logs
cd spkg && \
"../$(PIPE)" \
"env SAGE_PARALLEL_SPKG_BUILD='$(SAGE_PARALLEL_SPKG_BUILD)' ./install all 2>&1" \
"tee -a ../logs/install.log"
./sage -b
# ssl: build Sage, and also install pyOpenSSL. This is necessary for
# running the secure notebook. This make target requires internet
# access. Note that this requires that your system have OpenSSL
# libraries and headers installed. See README.txt for more
# information.
ssl: all
./sage -i pyopenssl
build-serial: SAGE_PARALLEL_SPKG_BUILD = no
build-serial: build
# Start Sage if the file local/etc/sage-started.txt does not exist
# (i.e. when we just installed Sage for the first time).
start: build
[ -f local/etc/sage-started.txt ] || local/bin/sage-starts
# You can choose to have the built HTML version of the documentation link to
# the PDF version. To do so, you need to build both the HTML and PDF versions.
# To have the HTML version link to the PDF version, do
#
# $ ./sage --docbuild all html
# $ ./sage --docbuild all pdf
#
# For more information on the docbuild utility, do
#
# $ ./sage --docbuild -H
doc: doc-html
doc-html: build
$(PIPE) "./sage --docbuild --no-pdf-links all html $(SAGE_DOCBUILD_OPTS) 2>&1" "tee -a logs/dochtml.log"
doc-html-mathjax: build
$(PIPE) "./sage --docbuild --no-pdf-links all html -j $(SAGE_DOCBUILD_OPTS) 2>&1" "tee -a logs/dochtml.log"
# Keep target 'doc-html-jsmath' for backwards compatibility.
doc-html-jsmath: doc-html-mathjax
doc-pdf: build
$(PIPE) "./sage --docbuild all pdf $(SAGE_DOCBUILD_OPTS) 2>&1" "tee -a logs/docpdf.log"
doc-clean:
@echo "Deleting devel/sage/doc/output..."
rm -rf devel/sage/doc/output
clean:
@echo "Deleting spkg/build..."
rm -rf spkg/build
@echo "Deleting spkg/archive..."
rm -rf spkg/archive
distclean: clean
@echo "Deleting all remaining traces of builds, tests etc. ..."
rm -rf local
rm -f spkg/Makefile
rm -rf spkg/installed
rm -rf spkg/logs
rm -rf spkg/optional
rm -rf logs
rm -f spkg/parallel_make.cfg
rm -rf dist
rm -rf devel
rm -rf doc
rm -rf examples
rm -rf sage-python
rm -rf matplotlibrc
rm -rf tmp
rm -f .BUILDSTART
micro_release:
bash -c ". spkg/bin/sage-env && local/bin/sage-micro_release"
text-expand:
./spkg/bin/text-expand
text-collapse:
./spkg/bin/text-collapse
TESTPRELIMS = local/bin/sage-starts
TESTALL = ./sage -t --all
PTESTALL = ./sage -t -p --all
test: all # i.e. build and doc
$(TESTPRELIMS)
$(TESTALL) --logfile=logs/test.log
check: test
testall: all # i.e. build and doc
$(TESTPRELIMS)
$(TESTALL) --optional=all --logfile=logs/testall.log
testlong: all # i.e. build and doc
$(TESTPRELIMS)
$(TESTALL) --long --logfile=logs/testlong.log
testalllong: all # i.e. build and doc
$(TESTPRELIMS)
$(TESTALL) --long --optional=all --logfile=logs/testalllong.log
ptest: all # i.e. build and doc
$(TESTPRELIMS)
$(PTESTALL) --logfile=logs/ptest.log
ptestall: all # i.e. build and doc
$(TESTPRELIMS)
$(PTESTALL) --optional=all --logfile=logs/ptestall.log
ptestlong: all # i.e. build and doc
$(TESTPRELIMS)
$(PTESTALL) --long --logfile=logs/ptestlong.log
ptestalllong: all # i.e. build and doc
$(TESTPRELIMS)
$(PTESTALL) --long --optional=all --logfile=logs/ptestalllong.log
testoptional: testall # just an alias
testoptionallong: testalllong # just an alias
ptestoptional: ptestall # just an alias
ptestoptionallong: ptestalllong # just an alias
install:
echo "Experimental use only!"
if [ "$(DESTDIR)" = "" ]; then \
echo >&2 "Set the environment variable DESTDIR to the install path."; \
exit 1; \
fi
# Make sure we remove only an existing directory. If $(DESTDIR)/sage is
# a file instead of a directory then the mkdir statement later will fail
if [ -d "$(DESTDIR)"/sage ]; then \
rm -rf "$(DESTDIR)"/sage; \
fi
mkdir -p "$(DESTDIR)"/sage
mkdir -p "$(DESTDIR)"/bin
cp -Rp * "$(DESTDIR)"/sage
rm -f "$(DESTDIR)"/bin/sage
ln -s ../sage/sage "$(DESTDIR)"/bin/sage
"$(DESTDIR)"/bin/sage -c # Run sage-location
.PHONY: all build build-serial start install \
doc doc-html doc-html-jsmath doc-html-mathjax doc-pdf \
doc-clean clean distclean \
test check testoptional testall testlong testoptionallong testallong \
ptest ptestoptional ptestall ptestlong ptestoptionallong ptestallong