-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
63 lines (53 loc) · 1.8 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
all: build
.PHONY: build
build:
$(shell [[ $EUID -eq 0 ]] && echo "build can not be run as root" && exit 1)
@echo ":: Rebuilding in release mode..."
@cargo build --release
.PHONY: build-debug
build-debug:
$(shell [[ $EUID -eq 0 ]] && echo "build can not be run as root" && exit 1)
@echo ":: Rebuilding in debug mode..."
@cargo build
.PHONY: install-helpers
install-helpers:
@echo ":: Installing ./bin..."
@mkdir -p /usr/local/bin
@cp -R bin/. /usr/local/bin
@ls bin | xargs -I {} chmod 755 /usr/local/bin/{}
@echo ":: Installing ./scripts..."
@cp -r scripts /usr/local
@ls scripts | xargs -I {} chmod 755 /usr/local/scripts/{}
@echo ":: Copying over xsession file..."
@cp penrose-from-scratch.desktop /usr/share/xsessions/
.PHONY: install-penrose-release
install-penrose-release:
@echo ":: Installing release build of penrose-from-scratch..."
@mkdir -p /usr/local/bin
@cp -f target/release/penrose-from-scratch /usr/local/bin
@chmod 755 /usr/local/bin/penrose-from-scratch
.PHONY: install-penrose-debug
install-penrose-debug:
@echo ":: Installing debug build of penrose-from-scratch..."
@strip target/debug/penrose-from-scratch
@mkdir -p /usr/local/bin
@cp -f target/debug/penrose-from-scratch /usr/local/bin
@chmod 755 /usr/local/bin/penrose-from-scratch
.PHONY: install
install: install-penrose-release install-helpers
@echo ":: Done"
.PHONY: install-debug
install-debug: install-penrose-debug install-helpers
@echo ":: Done"
.PHONY: uninstall
uninstall:
@echo ":: Removing binaries..."
@ls bin | xargs -I {} rm -f /usr/local/bin/{}
@rm -f /usr/local/bin/penrose-from-scratch
@echo ":: Removing scripts..."
@ls scripts | xargs -I {} rm -f /usr/local/scripts/{}
@echo ":: Done"
.PHONY: update-penrose
update-penrose:
@echo "Updating to latest version of penrose from GitHub..."
cargo update -p penrose