1+ .DEFAULT_GOAL := help
2+
3+ # ###############################################################################
4+
15RUST_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
46RUST_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
69RUST_CHANNEL ?= dev
10+ RUST_CODEGEN_BACKENDS ?= llvm
11+ RUST_USE_LLD ?= false
12+ RUST_VERBOSE ?= 0
713RUST_DESCRIPTION ?= ""
814RUST_INSTALL_DIR ?= install
915RUST_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 ?=
2017
2118# Note: use Makefile.local for customization
19+ -include misc/make/utility.Makefile
2220-include misc/make/doc.Makefile
2321-include misc/make/offline.Makefile
2422-include Makefile.local
@@ -36,45 +34,87 @@ download: ## Download Rust sources
3634# # ▸▸▸ Configure commands ◂◂◂
3735
3836.PHONY : configure
39- configure : # # Configure Rust
37+ configure : # # Configure Rust & LLVM with optimizations
4038 cd rust && ./configure \
4139 --enable-option-checking \
40+ --enable-verbose-configure \
41+ --enable-sccache \
42+ --enable-ninja \
4243 --enable-verbose-tests \
43- --codegen-backends=llvm \
4444 --enable-codegen-tests \
4545 --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} \
4777 --target=${RUST_TARGETS} \
78+ --tools=${RUST_TOOLS} \
4879 --set llvm.download-ci-llvm=true \
4980 --set build.verbose=${RUST_VERBOSE} \
5081 --set rust.channel=${RUST_CHANNEL} \
5182 --set rust.description=${RUST_DESCRIPTION} \
5283 --set rust.use-lld=${RUST_USE_LLD} \
5384 --dist-compression-formats=${RUST_DIST_FORMATS} \
54- --prefix=${RUST_INSTALL_DIR}
85+ --prefix=${RUST_INSTALL_DIR} \
86+ ${RUST_CONFIGURE_ARGS}
5587
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
5890 cd rust && ./configure \
5991 --enable-option-checking \
60- --enable-sccache \
61- --enable-ninja \
92+ --enable-verbose-configure \
6293 --enable-verbose-tests \
6394 --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 } \
6798 --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} \
68104 --set llvm.download-ci-llvm=false \
69105 --set llvm.targets=" AArch64;X86" \
70106 --set llvm.experimental-targets=" " \
107+ --set llvm.static-libstdcpp \
71108 --set llvm.tests=true \
72109 --set build.verbose=${RUST_VERBOSE} \
73110 --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} \
75114 --set rust.omit-git-hash=true \
76115 --dist-compression-formats=${RUST_DIST_FORMATS} \
77- --prefix=${RUST_INSTALL_DIR}
116+ --prefix=${RUST_INSTALL_DIR} \
117+ ${RUST_CONFIGURE_ARGS}
78118
79119# # ▸▸▸ Target Info commands ◂◂◂
80120
0 commit comments