forked from timdiels/zeroinstall
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
42 lines (30 loc) · 1.13 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
PYTHON=$(shell which python3 || echo python)
MO = $(shell find share/locale -name '*.po' | sort | sed -e 's/\.po/\.mo/')
PY = $(shell find zeroinstall -name '*.py' | sort)
GTKBUILDER = $(shell find zeroinstall -name '*.ui' | sort | sed -e 's/\.ui/&.h/')
SH = zeroinstall/zerostore/_unlzma
all: translations
$(PYTHON) setup.py build
translations: $(MO)
install: all
$(PYTHON) setup.py install --force
%.mo: %.po
msgfmt -o "$@" "$<"
%.ui.h: %.ui
intltool-extract --type=gettext/glade --update "$<"
share/locale/zero-install.pot: $(PY) $(GTKBUILDER) $(SH)
xgettext --sort-by-file --language=Python --output=$@ --keyword=N_ $(PY) $(GTKBUILDER)
xgettext --sort-by-file --language=Shell -j --output=$@ $(SH)
update-po: share/locale/zero-install.pot
@for po in share/locale/*/LC_MESSAGES/zero-install.po; do \
echo -e "Merge: $$po: \c"; \
msgmerge -v -U $$po share/locale/zero-install.pot; \
done
check-po:
@for po in share/locale/*/LC_MESSAGES/zero-install.po; do \
echo -e "Check: $$po: \c"; \
msgfmt -o /dev/null --statistics -v -c $$po; \
done
clean:
$(PYTHON) setup.py clean
.PHONY: all install update-po check-po clean