forked from sainnhe/capitaine-cursors
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
99 lines (76 loc) · 2.51 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
all: clean render build
.PHONY: all
# Default
clean:
@rm -rf bitmaps themes
render: bitmapper svg
@cd bitmapper && make install render_dark render_light
build: bitmaps
@cd builder && make setup build
# Specific platform build
unix: clean render bitmaps
@cd builder && make setup build_unix
windows: clean render bitmaps
@cd builder && make setup build_windows
# Dark
dark: clean render_dark build_dark
render_dark: bitmapper svg
@cd bitmapper && make install render_dark
build_dark: bitmaps
@cd builder && make setup build_dark
# Light
light: clean render_light build_light
render_light: bitmapper svg
@cd bitmapper && make install render_light
build_light: bitmaps
@cd builder && make setup build_light
# Installation
.ONESHELL:
SHELL:=/bin/bash
THEME_PREFIX = "Capitaine"
src := ./themes/
local := ~/.icons
local_dest := $(local)/$(theme)
root := /usr/share/icons
root_dest := $(root)/$(theme)
install: $(src)
@if [[ $EUID -ne 0 ]]; then
@echo "> Installing '$(THEME_PREFIX)' cursors inside $(local)/..."
@mkdir -p $(local)
@cp -r "./themes/$(THEME_PREFIX) Dark" $(local_dest)
@cp -r "./themes/$(THEME_PREFIX) Light" $(local_dest)
@else
@echo "> Installing '$(THEME_PREFIX)' cursors inside $(root)/..."
@mkdir -p $(root)
@sudo cp -r "./themes/$(THEME_PREFIX) Dark" $(root_dest)
@sudo cp -r "./themes/$(THEME_PREFIX) Light" $(root_dest)
@fi
uninstall:
@if [[ $EUID -ne 0 ]]; then
@echo "> Removing '$(THEME_PREFIX)' from '$(local)'..."
@rm -rf "$(local)/$(THEME_PREFIX) Dark"
@rm -rf "$(local)/$(THEME_PREFIX) Light"
@else
@echo "> Removing '$(THEME_PREFIX)' from '$(root)'..."
@rm -rf "$(root)/$(THEME_PREFIX) Dark"
@rm -rf "$(root)/$(THEME_PREFIX) Light"
@fi
reinstall: uninstall install
# generates binaries
BIN_DIR = ../bin
THEMES = White
prepare: bitmaps themes
@rm -rf bin
@mkdir -p "bin/$(THEME_PREFIX) Dark"
@mkdir -p "bin/$(THEME_PREFIX) Light"
@cd bitmaps
@zip -r "$(BIN_DIR)/$(THEME_PREFIX) Dark/bitmaps.zip" "$(THEME_PREFIX) Dark"
@zip -r "$(BIN_DIR)/$(THEME_PREFIX) Light/bitmaps.zip" "$(THEME_PREFIX) Light"
@zip -r $(BIN_DIR)/bitmaps.zip *
@cd ..
@cd themes
@tar -czvf "$(BIN_DIR)/$(THEME_PREFIX) Dark/$(THEME_PREFIX) Dark.tar.gz" "$(THEME_PREFIX) Dark"
@zip -r "$(BIN_DIR)/$(THEME_PREFIX) Dark/$(THEME_PREFIX) Dark Windows.zip" "$(THEME_PREFIX) Dark Windows"
@tar -czvf "$(BIN_DIR)/$(THEME_PREFIX) Light/$(THEME_PREFIX) Light.tar.gz" "$(THEME_PREFIX) Light"
@zip -r "$(BIN_DIR)/$(THEME_PREFIX) Light/$(THEME_PREFIX) Light Windows.zip" "$(THEME_PREFIX) Light Windows"
@cd ..