1
+ .DEFAULT_GOAL := help
2
+
3
+ # ###############################################################################
4
+
1
5
RUST_GIT_URL ?= https://github.com/rust-lang/rust.git
2
- RUST_TOOLS ?= cargo,clippy,rustdoc,rustfmt,rust-analyzer,analysis,src
3
- RUST_TARGETS ?= aarch64-apple-darwin,aarch64-apple-ios,arm64e-apple-darwin,arm64e-apple-ios
4
6
RUST_HOST ?= x86_64-apple-darwin
5
- RUST_VERBOSE ?= 0
7
+ RUST_TARGETS ?= arm64e-apple-darwin
8
+ RUST_TOOLS ?= cargo,clippy,rustdoc,rustfmt,rust-analyzer,analysis,src
6
9
RUST_CHANNEL ?= dev
10
+ RUST_CODEGEN_BACKENDS ?= llvm
11
+ RUST_USE_LLD ?= false
12
+ RUST_VERBOSE ?= 0
7
13
RUST_DESCRIPTION ?= ""
8
14
RUST_INSTALL_DIR ?= install
9
15
RUST_DIST_FORMATS ?= xz
10
- RUST_USE_LLD ?= false
11
-
12
- # # ▸▸▸ Auxiliary commands ◂◂◂
13
- .PHONY : help
14
- help : # # Show this help
15
- @fgrep -h " ## " $(MAKEFILE_LIST ) | fgrep -v fgrep | sed -e ' s/\\$$//' | sed -e ' s/## //'
16
-
17
- .PHONY : clean
18
- clean : # # Remove download artifacts
19
- rm -rf rust
16
+ RUST_CONFIGURE_ARGS ?=
20
17
21
18
# Note: use Makefile.local for customization
19
+ -include misc/make/utility.Makefile
22
20
-include misc/make/doc.Makefile
23
21
-include misc/make/offline.Makefile
24
22
-include Makefile.local
@@ -36,45 +34,87 @@ download: ## Download Rust sources
36
34
# # ▸▸▸ Configure commands ◂◂◂
37
35
38
36
.PHONY : configure
39
- configure : # # Configure Rust
37
+ configure : # # Configure Rust & LLVM with optimizations
40
38
cd rust && ./configure \
41
39
--enable-option-checking \
40
+ --enable-verbose-configure \
41
+ --enable-sccache \
42
+ --enable-ninja \
42
43
--enable-verbose-tests \
43
- --codegen-backends=llvm \
44
44
--enable-codegen-tests \
45
45
--enable-dist-src \
46
- --tools=${RUST_TOOLS} \
46
+ --enable-optimize-llvm \
47
+ --enable-full-tools \
48
+ --enable-sanitizers \
49
+ --enable-profiler \
50
+ --host=${RUST_HOST} \
51
+ --target=${RUST_TARGETS} \
52
+ --set llvm.download-ci-llvm=false \
53
+ --set llvm.targets=" AArch64;X86" \
54
+ --set llvm.experimental-targets=" " \
55
+ --set llvm.static-libstdcpp \
56
+ --set llvm.tests=true \
57
+ --set build.verbose=${RUST_VERBOSE} \
58
+ --set rust.channel=${RUST_CHANNEL} \
59
+ --set rust.jemalloc \
60
+ --set rust.lto=thin \
61
+ --set rust.codegen-units=1 \
62
+ --set rust.codegen-backends=${RUST_CODEGEN_BACKENDS} \
63
+ --set rust.use-lld=${RUST_USE_LLD} \
64
+ --set rust.omit-git-hash=true \
65
+ --dist-compression-formats=${RUST_DIST_FORMATS} \
66
+ --prefix=${RUST_INSTALL_DIR} \
67
+ ${RUST_CONFIGURE_ARGS}
68
+
69
+ .PHONY : configure-dev
70
+ configure-dev : # # Configure Rust without optimizations
71
+ cd rust && ./configure \
72
+ --enable-option-checking \
73
+ --enable-verbose-configure \
74
+ --enable-verbose-tests \
75
+ --enable-codegen-tests \
76
+ --host=${RUST_HOST} \
47
77
--target=${RUST_TARGETS} \
78
+ --tools=${RUST_TOOLS} \
48
79
--set llvm.download-ci-llvm=true \
49
80
--set build.verbose=${RUST_VERBOSE} \
50
81
--set rust.channel=${RUST_CHANNEL} \
51
82
--set rust.description=${RUST_DESCRIPTION} \
52
83
--set rust.use-lld=${RUST_USE_LLD} \
53
84
--dist-compression-formats=${RUST_DIST_FORMATS} \
54
- --prefix=${RUST_INSTALL_DIR}
85
+ --prefix=${RUST_INSTALL_DIR} \
86
+ ${RUST_CONFIGURE_ARGS}
55
87
56
- .PHONY : configure-with -llvm
57
- configure-with -llvm : # # Configure Rust and LLVM
88
+ .PHONY : configure-dev -llvm
89
+ configure-dev -llvm : # # Configure Rust & LLVM without optimizations
58
90
cd rust && ./configure \
59
91
--enable-option-checking \
60
- --enable-sccache \
61
- --enable-ninja \
92
+ --enable-verbose-configure \
62
93
--enable-verbose-tests \
63
94
--enable-codegen-tests \
64
- --enable-dist-src \
65
- --enable-full-tools \
66
- --tools =${RUST_TOOLS } \
95
+ --enable-sccache \
96
+ --enable-ninja \
97
+ --host =${RUST_HOST } \
67
98
--target=${RUST_TARGETS} \
99
+ --tools=${RUST_TOOLS} \
100
+ --enable-debug-assertions \
101
+ --enable-overflow-checks \
102
+ --enable-llvm-assertions \
103
+ --codegen-backends=${RUST_CODEGEN_BACKENDS} \
68
104
--set llvm.download-ci-llvm=false \
69
105
--set llvm.targets=" AArch64;X86" \
70
106
--set llvm.experimental-targets=" " \
107
+ --set llvm.static-libstdcpp \
71
108
--set llvm.tests=true \
72
109
--set build.verbose=${RUST_VERBOSE} \
73
110
--set rust.channel=${RUST_CHANNEL} \
74
- --set rust.description=${RUST_DESCRIPTION} \
111
+ --set rust.verify-llvm-ir \
112
+ --set rust.use-lld=${RUST_USE_LLD} \
113
+ --set rust.codegen-backends=${RUST_CODEGEN_BACKENDS} \
75
114
--set rust.omit-git-hash=true \
76
115
--dist-compression-formats=${RUST_DIST_FORMATS} \
77
- --prefix=${RUST_INSTALL_DIR}
116
+ --prefix=${RUST_INSTALL_DIR} \
117
+ ${RUST_CONFIGURE_ARGS}
78
118
79
119
# # ▸▸▸ Target Info commands ◂◂◂
80
120
0 commit comments