-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: restructure Makefile for better readability (#17)
- Removed redundant targets - Grouped related tasks together
- Loading branch information
Showing
4 changed files
with
35 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
RUST_PREBUILT_VERSION ?= $(shell curl --silent https://static.rust-lang.org/dist/channel-rust-beta.toml | grep '^date = "' | sed 's/date = "\(.*\)"/\1/') | ||
RUST_PREBUILT_COMPONENTS ?= rust-std rustc cargo rustfmt | ||
RUST_PREBUILT_CHANNELS ?= beta nightly | ||
RUST_PREBUILT_TARGET ?= x86_64-apple-darwin | ||
RUST_PREBUILT_OUTPUT_DIR ?= rust/build/cache | ||
|
||
## ▸▸▸ Offline commands ◂◂◂ | ||
|
||
.PHONY: offline | ||
offline: SHELL:=/bin/bash | ||
offline: ## Download prebuilt Rust binaries and cache them for offline use | ||
mkdir -p ${RUST_PREBUILT_OUTPUT_DIR}/${RUST_PREBUILT_VERSION} | ||
@for RUST_CHANNEL in ${RUST_PREBUILT_CHANNELS}; do \ | ||
for RUST_COMPONENT in ${RUST_PREBUILT_COMPONENTS}; do \ | ||
RUST_FILENAME=${RUST_PREBUILT_VERSION}/$${RUST_COMPONENT}-$${RUST_CHANNEL}-${RUST_PREBUILT_TARGET}.tar.xz ; \ | ||
INFO="\nFile Name: $${RUST_FILENAME}\nSize: %{size_download} bytes\nSpeed: %{speed_download} bytes/sec\nTime: %{time_total} seconds\n\n" ; \ | ||
URL=https://static.rust-lang.org/dist/$${RUST_FILENAME} ; \ | ||
OUTPUT=${RUST_PREBUILT_OUTPUT_DIR}/$${RUST_FILENAME} ; \ | ||
curl --fail --progress-bar --write-out "$${INFO}" $${URL} --output $${OUTPUT} ; \ | ||
done; \ | ||
done; |