/
deps
145 lines (130 loc) · 4.82 KB
/
deps
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
###############################################################################
# This file ($SAGE_ROOT/build/deps) will be copied into
# $SAGE_ROOT/build/Makefile by $SAGE_ROOT/build/install
###############################################################################
# Do not put an explicit path for sage-spkg here, it will be found in $PATH.
SAGE_SPKG = sage-spkg -f
PIPE = $(SAGE_ROOT)/build/pipestatus
# Tell make not to look for files with these names:
.PHONY: all all-sage base toolchain toolchain-deps
# Make the 5 build phases:
# prereq, base, toolchain, toolchain-deps, all-sage
# During the toolchain build, we export SAGE_BUILD_TOOLCHAIN=yes
# such that packages can do different things when they are built
# as prerequisite of GCC.
all:
$(MAKE) $(INST)/prereq
$(MAKE) base
env SAGE_BUILD_TOOLCHAIN=yes $(MAKE) toolchain
$(MAKE) toolchain-deps
$(MAKE) all-sage
# All targets except for the base packages
all-sage: \
$(STANDARD_PACKAGES) \
$(OPTIONAL_INSTALLED_PACKAGES) \
$(INST)/$(SAGE_MP_LIBRARY) \
$(INST)/sage \
$(EXTCODE) \
$(SCRIPTS)
# TOOLCHAIN consists of dependencies determined by build/install,
# including for example the GCC package.
toolchain: $(TOOLCHAIN)
# Build all packages that GCC links against serially, otherwise this
# leads to race conditions where some library which is used by GCC gets
# reinstalled. Since system GCCs might use Sage's libraries, we do this
# unconditionally. We still use the dependency checking from $(MAKE),
# so this will not trigger useless rebuilds.
# See #14168 and #14232.
toolchain-deps:
$(MAKE) $(INST)/$(ZLIB)
$(MAKE) $(INST)/$(SAGE_MP_LIBRARY)
$(MAKE) $(INST)/$(MPFR)
$(MAKE) $(INST)/$(MPC)
$(MAKE) $(INST)/$(PPL)
# Everything needed to start up Sage using "./sage". Of course, not
# every part of Sage will work. It does not include Maxima for example.
SAGERUNTIME = $(SCRIPTS) $(INST)/sage $(INST)/$(IPYTHON) $(INST)/$(PEXPECT)
###############################################################################
# Building the base system
#
# This consists of packages which are required for the Sage build system.
###############################################################################
base: $(INST)/$(BZIP2) $(INST)/$(PATCH) $(INST)/$(PKGCONF)
$(INST)/prereq: ../configure
@cd ..; rm -f config.log; ln -s logs/pkgs/config.log config.log; \
./configure $$PREREQ_OPTIONS || ( \
if [ "x$$SAGE_PORT" = x ]; then \
echo "If you would like to try to build Sage anyway (to help porting),"; \
echo "export the variable 'SAGE_PORT' to something non-empty."; \
exit 1; \
else \
echo "Since 'SAGE_PORT' is set, we will try to build anyway."; \
fi; )
touch $@
###############################################################################
# Building normal packages
###############################################################################
# List all *build-time* dependencies of the Sage library. These are,
# on the one hand, programs needed for the build/install process of the
# Sage library (e.g. JINJA2), and on the
# other hand all dependencies for Cython files (e.g. PARI, NTL, SAGE_MP_LIBRARY).
$(INST)/sage: \
$(INST)/$(ATLAS) \
$(INST)/$(CEPHES) \
$(INST)/$(CLIQUER) \
$(INST)/$(CYTHON) \
$(INST)/$(ECL) \
$(INST)/$(ECLIB) \
$(INST)/$(ECM) \
$(INST)/$(FLINT) \
$(INST)/$(LIBFPLLL) \
$(INST)/$(LIBGD) \
$(INST)/$(GIVARO) \
$(INST)/$(GLPK) \
$(INST)/$(GSL) \
$(INST)/$(IML) \
$(INST)/$(JINJA2) \
$(INST)/$(LCALC) \
$(INST)/$(LRCALC) \
$(INST)/$(LIBGAP) \
$(INST)/$(LIBPNG) \
$(INST)/$(LINBOX) \
$(INST)/$(M4RI) \
$(INST)/$(M4RIE) \
$(INST)/$(MPC) \
$(INST)/$(MPFI) \
$(INST)/$(MPFR) \
$(INST)/$(SAGE_MP_LIBRARY) \
$(INST)/$(NTL) \
$(INST)/$(NUMPY) \
$(INST)/$(PARI) \
$(INST)/$(PLANARITY) \
$(INST)/$(POLYBORI) \
$(INST)/$(PPL) \
$(INST)/$(PYNAC) \
$(INST)/$(PYTHON) \
$(INST)/$(RATPOINTS) \
$(INST)/$(READLINE) \
$(INST)/$(RW) \
$(INST)/$(SINGULAR) \
$(INST)/$(SIX) \
$(INST)/$(SYMMETRICA) \
$(INST)/$(ZN_POLY)
if [ -z "$$SAGE_INSTALL_FETCH_ONLY" ]; then \
cd $(SAGE_SRC) && source bin/sage-env && \
$(PIPE) 'time $(MAKE) sage 2>&1' 'tee -a $(SAGE_LOGS)/sage-$(SAGE_VERSION).log' && \
touch $@; \
fi
###############################################################################
# Building scripts and extcode
###############################################################################
# Don't just use "install" since we don't want to change permissions
$(SAGE_LOCAL)/bin/%: $(SAGE_SRC)/bin/%
cp $< $@
# Don't just use "install -D" since we don't want to change permissions.
# cp won't correctly setup the SAGE_EXTCODE directory structure
# (unlike install), so we need a mkdir here such that cp can copy into
# an existing folder.
$(SAGE_EXTCODE)/%: $(SAGE_SRC)/ext/%
@mkdir -p "$(@D)"
cp $< $@