-
Notifications
You must be signed in to change notification settings - Fork 71
/
Makefile
79 lines (68 loc) · 2.47 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
PREFIX ?= /usr
VERSION="10.1.2"
MSGFMT = /usr/bin/msgfmt
GLIB_COMPILE_SCHEMAS = /usr/bin/glib-compile-schemas
EXTENSION_INSTALL_DIR = "$(PREFIX)/share/gnome-shell/extensions/[email protected]"
EXTENSION_FILES="$(shell find . \
-path './.git' -prune -o \
-path './img' -prune -o \
-path './target' -prune -o \
-path './node_modules' -prune -o \
-path ./.github -prune -o \
-path './scripts' -prune -o \
-path './dist' -prune -o \
-path './schemas/org.gnome.shell.extensions.cpupower.gschema.xml' -prune -o \
-name 'package-lock.json' -prune -o \
-name 'Makefile' -prune -o \
-name 'README.md' -prune -o \
-name '.gitignore' -prune -o \
-name '*~' -prune -o \
-name '*.yml' -prune -o \
-name '*.po' -prune -o \
-name '*.pot' -prune -o \
-type f -print)"
DIST_FILES="$(shell find . \
-path './.git' -prune -o \
-path './img' -prune -o \
-path './target' -prune -o \
-path './node_modules' -prune -o \
-path ./.github -prune -o \
-path './dist/rpm/BUILD' -prune -o \
-path './dist/rpm/BUILDROOT' -prune -o \
-path './dist/rpm/RPMS' -prune -o \
-path './dist/rpm/SRPMS' -prune -o \
-path './dist/deb/gnome-shell-extension-cpupower-*' -prune -o \
-path './dist/deb/gnome-shell-extension-cpupower_*' -prune -o \
-name 'package-lock.json' -prune -o \
-name '.gitignore' -prune -o \
-name '*~' -prune -o \
-name '*.yml' -prune -o \
-name '*.pot' -prune -o \
-type f -print)"
build:
@echo Compiling schemas...
@$(GLIB_COMPILE_SCHEMAS) ./schemas
@echo Updating translations...
@MSGFMT="$(MSGFMT)" ./scripts/update-translations.sh
clean:
@rm -rf target
@find dist -mindepth 1 -maxdepth 1 -type d -exec $(MAKE) -C {} VERSION=$(VERSION) clean \;
package: build
@mkdir -p target
@rm -f target/cpupower-${VERSION}.zip
@zip target/cpupower-${VERSION}.zip "$(EXTENSION_FILES)"
@tar czf target/gnome-shell-extension-cpupower-${VERSION}.tar.gz "$(DIST_FILES)"
@find dist -mindepth 1 -maxdepth 1 -type d -exec $(MAKE) -C {} VERSION=$(VERSION) update-tarball \;
dist: package
@find dist -mindepth 1 -maxdepth 1 -type d -exec $(MAKE) -C {} VERSION=$(VERSION) build \;
install: package
@mkdir -p "$(EXTENSION_INSTALL_DIR)"
@unzip -o target/cpupower-${VERSION}.zip -d "$(EXTENSION_INSTALL_DIR)"
uninstall:
@rm -r "$(EXTENSION_INSTALL_DIR)"
install-tool:
@./tool/installer.sh --prefix "$(PREFIX)" --tool-suffix "$(TOOL_SUFFIX)" install
uninstall-tool:
@./tool/installer.sh --prefix "$(PREFIX)" --tool-suffix "$(TOOL_SUFFIX)" uninstall
release:
@./scripts/release.sh "$(VERSION)"