-
Notifications
You must be signed in to change notification settings - Fork 14
/
Makefile
54 lines (41 loc) · 1.62 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
.PHONY: all build clean uninstall
SHELL := /bin/bash
EXTENSION := emoji-copy@felipeftn
EXTENSION_NAME := emoji-copy
EXTENSION_PATH = ~/.local/share/gnome-shell/extensions/$(EXTENSION)
ZIP_NAME := $(EXTENSION).zip
ZIP_TEMP := zip-temp
SCHEMA_FILE = $(EXTENSION)/schemas/org.gnome.shell.extensions.emoji-copy.gschema.xml
SCHEMA_COMPILED_FILE = $(EXTENSION)/schemas/gschemas.compiled
EMOJIS_DB = $(EXTENSION)/data/emojis.db
ZIP_CONTENT = $(EXTENSION)/* LICENSE
all: clean build
build: $(SCHEMA_COMPILED_FILE) $(EMOJIS_DB) $(ZIP_NAME)
@echo "[+] EMOJI COPY BUILT"
install: build
gnome-extensions install $(ZIP_NAME) --force
@echo "Extension installed successfully! Now restart the Shell ('Alt'+'F2', then 'restart')."
uninstall:
gnome-extensions uninstall $(EXTENSION)
@echo "Extension uninstalled successfully!"
clean:
@rm --force --recursive $(ZIP_NAME) $(SCHEMA_COMPILED_FILE) $(ZIP_TEMP) $(EMOJIS_DB) $(EXTENSION_PATH)
debug: clean install
dbus-run-session -- gnome-shell --nested --wayland
# Just to make it clear ($@ => First argument; $^ second argument)
# e.g: $@ => $(ZIP_NAME); $^ => $(ZIP_CONTENT).
$(ZIP_NAME):
@echo "[-] ZIPPING EMOJI COPY..."
@mkdir -p zip-temp
@cp -r $(ZIP_CONTENT) $(ZIP_TEMP)
@cd $(ZIP_TEMP) && find . -name ".gitkeep" -type f | xargs rm -rf
@cd $(ZIP_TEMP) && find . -name "*.pot" -type f | xargs rm -rf
@cd $(ZIP_TEMP) && find . -name "*.po" -type f | xargs rm -rf
@rm --force $@
@cd $(ZIP_TEMP) && zip -r ../$@ .
$(SCHEMA_COMPILED_FILE): $(SCHEMA_FILE)
@echo "[-] COMPILING SCHEMA..."
@glib-compile-schemas $(EXTENSION)/schemas
@echo "[+] SCHEMA COMPILED"
$(EMOJIS_DB):
@python3 ./build/parser.py