-
-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathMakefile
More file actions
68 lines (50 loc) · 1.54 KB
/
Makefile
File metadata and controls
68 lines (50 loc) · 1.54 KB
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
SYSTEM_CONFIG_DIR = /etc/hypr-dock
PROJECT_BIN_DIR = bin
PROJECT_CONFIG_DIR = configs/default
EXECUTABLE_DOCK = hypr-dock
EXECUTABLE_ALTTAB = hypr-alttab
CMD_DOCK = ./cmd/hypr-dock/.
CMD_ALTTAB = ./cmd/hypr-alttab/.
RESET := \033[0m
GREEN := \033[32m
YELLOW := \033[33m
LOG_LEVEL ?= trace
get:
go mod tidy
warn:
@if [ ! -f "$(PROJECT_BIN_DIR)/$(EXECUTABLE_DOCK)" ]; then \
echo -e "$(YELLOW)The first build may take an extremely long time due to linking with gtk3...$(RESET)"; \
fi
build-all:
$(MAKE) build-dock
$(MAKE) build-alttab
build: build-all
build-dock:
$(MAKE) warn
go build -v -o $(PROJECT_BIN_DIR)/$(EXECUTABLE_DOCK) $(CMD_DOCK)
build-alttab:
$(MAKE) warn
go build -v -o $(PROJECT_BIN_DIR)/$(EXECUTABLE_ALTTAB) $(CMD_ALTTAB)
install: install-all
install-dock:
-sudo killall $(EXECUTABLE_DOCK) 2>/dev/null || true
sudo cp $(PROJECT_BIN_DIR)/$(EXECUTABLE_DOCK) /usr/bin/
@echo -e "$(GREEN)hypr-dock installed$(RESET)"
install-alttab:
-sudo killall $(EXECUTABLE_ALTTAB) 2>/dev/null || true
sudo cp $(PROJECT_BIN_DIR)/$(EXECUTABLE_ALTTAB) /usr/bin/
@echo -e "$(GREEN)hypr-alttab installed$(RESET)"
update-config:
sudo -rf $(PROJECT_CONFIG_DIR)/. $(SYSTEM_CONFIG_DIR)/
@echo -e "$(GREEN)Configs copied to $(SYSTEM_CONFIG_DIR)$(RESET)
install-all:
$(MAKE) install-dock
$(MAKE) install-alttab
$(MAKE) update-config
uninstall:
sudo rm -f /usr/bin/$(EXECUTABLE_DOCK)
sudo rm -f /usr/bin/$(EXECUTABLE_ALTTAB)
sudo rm -rf $(SYSTEM_CONFIG_DIR)
@echo -e "$(GREEN)Uninstalled.$(RESET)"
exec:
./bin/hypr-dock -dev -log-level $(LOG_LEVEL)