-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
69 lines (60 loc) · 2.26 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
64
65
66
67
68
69
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
SHARE_DIR := /usr/share
TARGET_DIR := /usr/bin
CONFIG_DIR := /etc
define gen_manpages
pandoc --standalone --to man $(ROOT_DIR)/man/src/oxide.1.md -o $(ROOT_DIR)/man/oxide.1
pandoc --standalone --to man $(ROOT_DIR)/man/src/oxide-bar.1.md -o $(ROOT_DIR)/man/oxide-bar.1
pandoc --standalone --to man $(ROOT_DIR)/man/src/oxide-config.1.md -o $(ROOT_DIR)/man/oxide-config.1
pandoc --standalone --to man $(ROOT_DIR)/man/src/oxide-msg.1.md -o $(ROOT_DIR)/man/oxide-msg.1
endef
run:
cd $(ROOT_DIR)
@echo -e "\x1b[1m\x1b[36m#- Thank you for using OxideWM -#\x1b[0m"
$(ROOT_DIR)/resources/install_required_apps.sh
$(ROOT_DIR)/resources/run_oxide.sh
install:
@echo -e "\x1b[1m\x1b[36m#- Thank you for installing OxideWM -#\x1b[0m"
cd $(ROOT_DIR)
$(ROOT_DIR)/resources/install_required_apps.sh
cargo build --release
cargo build -p oxide-bar --release
cargo build -p oxide-msg --release
sudo mkdir -p $(CONFIG_DIR)/oxide
sudo install -Dm755 \
$(ROOT_DIR)/target/release/oxide \
$(ROOT_DIR)/target/release/oxide-bar \
$(ROOT_DIR)/target/release/oxide-msg \
-t $(TARGET_DIR)
sudo cp -t $(CONFIG_DIR)/oxide/ \
$(ROOT_DIR)/resources/config.yml \
$(ROOT_DIR)/bar_config.yml
sudo install -Dm644 $(ROOT_DIR)/resources/oxide.desktop $(SHARE_DIR)/xsessions/oxide.desktop
$(call gen_manpages)
sudo cp $(ROOT_DIR)/man/oxide.1 \
$(ROOT_DIR)/man/oxide-bar.1 \
$(ROOT_DIR)/man/oxide-config.1 \
$(ROOT_DIR)/man/oxide-msg.1 \
$(SHARE_DIR)/man/man1/
cd $(ROOT_DIR) && cargo clean
@echo -e "\x1b[1m\x1b[36m#- Oxide has been successfully installed -#\x1b[0m"
@echo -e "\x1b[1m\x1b[33m#- You can now log out and choose Oxide as your windowmanager -#\x1b[0m"
uninstall:
@echo -e "\x1b[1m\x1b[36m#- Uninstalling OxideWM -#\x1b[0m"
sudo rm -f\
$(TARGET_DIR)/oxide\
$(TARGET_DIR)/oxide-bar\
$(TARGET_DIR)/oxide-msg\
$(SHARE_DIR)/xsessions/oxide.desktop\
$(CONFIG_DIR)/oxide/config.yml \
$(SHARE_DIR)/man/man1/oxide.1 \
$(SHARE_DIR)/man/man1/oxide-bar.1 \
$(SHARE_DIR)/man/man1/oxide-config.1 \
$(SHARE_DIR)/man/man1/oxide-msg.1
@echo -e "\x1b[1m\x1b[36m#- Oxide has been successfully uninstalled -#\x1b[0m"
.PHONY: test
test:
$(ROOT_DIR)/test/resources/run_tests.sh
.PHONY: man
man:
$(call gen_manpages)