-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
36 lines (29 loc) · 1.3 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
setup: git_setup configure_sccache enable_incremental_compilation install_rustscript
@echo "Done."
git_setup: set_hooks
@echo "Setting up git settings..."
@git config --global pull.rebase true
set_hooks:
@echo "Setting up hooks path..."
@git config core.hooksPath hooks
configure_sccache: create_cargo_config install_sccache
@echo "Configuring sccache..."
@echo "[build]" >> .cargo/config.toml
@echo "rustc-wrapper = \"`which sccache`\"" >> .cargo/config.toml
install_sccache:
@which sccache >> /dev/null || echo "Installing sccache..."
@which sccache >> /dev/null || cargo install sccache
@which sccache >> /dev/null || cargo install sccache
install_rustscript:
@which rustscript >> /dev/null || echo 'Installing rustscript...'
@which rustscript >> /dev/null || cargo install --git https://github.com/faern/rustscript
@which rustscript >> /dev/null || echo 'Auth as root to symlink `rustscript` to `/usr`'
@which rustscript >> /dev/null || sudo ln -s ~/.cargo/bin/rustscript /usr/local/bin/
create_cargo_config:
@echo "Creating .cargo for local config..."
@mkdir -p .cargo
@echo|tr -d \\n > .cargo/config.toml
enable_incremental_compilation: create_cargo_config
@echo "Enabling incremental compilation..."
@echo "[profile.debug]" >> .cargo/config.toml
@echo "incremental = true" >> .cargo/config.toml