File: Makefile

package info (click to toggle)
gnome-shell-extension-runcat 21-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,480 kB
  • sloc: javascript: 297; makefile: 53; xml: 23
file content (70 lines) | stat: -rw-r--r-- 1,906 bytes parent folder | download
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
#!/usr/bin/make -f

.PHONY : build clean install uninstall open-prefs spawn-gnome-shell translations
.DEFAULT_GOAL := build

UUID = runcat@kolesnikov.se
DIST_ARCHIVE = $(UUID).shell-extension.zip
LOCAL = $(HOME)/.local/share/gnome-shell/extensions

all_sources = $(shell find src -type f)

js_sources = $(shell cd src && find . -maxdepth 1 -type f -name '*.js')

translations_sources = src/panelMenuButton.js src/prefs.js
translations_sources += $(shell find src/resources/ui -maxdepth 1 -type f -name '*.ui')
translations = $(shell find src/po -maxdepth 1 -type f -name '*.po')


build: dist/$(DIST_ARCHIVE)

dist:
	mkdir -p dist/

dist/$(DIST_ARCHIVE): dist $(all_sources)
	gnome-extensions pack -f src/ \
		$(addprefix --extra-source=, $(js_sources)) \
		--extra-source=./dataProviders \
		--extra-source=./resources \
		--extra-source=../LICENSE \
		--podir=./po \
		-o dist/


src/po/%.po: src/po/messages.pot
	msgmerge --update $@ src/po/messages.pot

src/po/messages.pot: $(translations_sources)
	xgettext \
		--package-name gnome-runcat-extension \
		--package-version 20 \
		--from-code=UTF-8 \
		--output=src/po/messages.pot \
		$^

translations: src/po/messages.pot $(translations)

clean:
	rm -rf dist

install: uninstall build
	gnome-extensions install dist/$(DIST_ARCHIVE) --force
	gnome-extensions enable $(UUID) || true
	echo "You need to restart GNOME Shell to apply changes"

uninstall:
	gnome-extensions uninstall $(UUID) || true


open-prefs:
	gnome-extensions prefs $(UUID)

spawn-gnome-shell:
	env MUTTER_DEBUG_DUMMY_MODE_SPECS=1600x800 \
	 	MUTTER_DEBUG_DUMMY_MONITOR_SCALES=1 \
		dbus-run-session -- gnome-shell --nested --wayland


help:
	@echo -n "Available commands: "
	@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$' | xargs