@superwhiskers/

rust.repl

polygott

No description

fork
loading
Files
  • Makefile
  • src
  • .gitignore
  • Cargo.lock
  • Cargo.toml
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
37
38
39
40
41
42
#
# rust.repl
# repl.it but with an updated rust version
#

#
# constants!
#

# set the root directory for the project
export project_root := $(CURDIR)

# cargo binary directory
export cargo_bin := $(project_root)/.cargo/bin

# rustup install command
export rustup_install_cmd := "bash <(curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs) -y"

#
# general build targets!
#

.PHONY: run
.DEFAULT_GOAL := run
run: $(project_root)/.rustup
	@$(cargo_bin)/cargo run

.PHONY: clean
clean: $(project_root)/.rustup
	@$(cargo_bin)/cargo clean

.PHONY: reset
reset:
	@rm -rf $(project_root)/.cargo $(project_root)/.rustup $(project_root)/target

#
# file targets!
#

$(project_root)/.rustup:
	@echo $(rustup_install_cmd) | bash