forked from kgshank/gse-disconnect-wifi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (45 loc) · 1.28 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
INSTALL_DIR=~/.local/share/gnome-shell/extensions
LOCALE_SRC=$(shell find $(SRC_DIR) -regextype posix-extended -regex '.*\.(js|glade)' 2> /dev/null)
LOCALE_DIR=$(SRC_DIR)/locale
POT_FILE=$(SRC_DIR)/po/disconnect-wifi.pot
PO_FILES=$(wildcard $(LOCALE_DIR)/*/LC_MESSAGES/*.po)
MO_FILES=$(PO_FILES:.po=.mo)
.PHONY: all
all: build install
.PHONY: build
build: $(MO_FILES)
glib-compile-schemas $(SRC_DIR)/schemas
.PHONY: potfile
potfile:
make $(POT_FILE)
.PHONY: mergepo
mergepo: $(POT_FILE)
@for po in $(PO_FILES); \
do \
msgmerge --add-location --backup=none --sort-output --update $${po} $(POT_FILE); \
done;
$(POT_FILE): $(LOCALE_SRC)
@xgettext \
--add-comments='Translators:' \
--add-location \
--from-code=utf-8 \
--keyword \
--keyword=_ \
--keyword=D_:2 \
--keyword=DC_:2 \
--keyword=DN_:2,3 \
--keyword=DP_:2c,3 \
--keyword=N_:1,2 \
--keyword=P_:1c,2 \
--output=$@ \
--package-name=disconnect-wifi \
--from-code=UTF-8 \
$^
$(LOCALE_DIR)/%/LC_MESSAGES/disconnect-wifi.mo: $(LOCALE_DIR)/%/LC_MESSAGES/disconnect-wifi.po
msgfmt --check --output-file=$@ $<
.PHONY: install
install:
@echo "Installing extension files in $(INSTALL_DIR)/[email protected]"
mkdir -p $(INSTALL_DIR)
cp -r [email protected] $(INSTALL_DIR)