-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
96 lines (81 loc) · 2.54 KB
/
Copy pathMakefile
File metadata and controls
96 lines (81 loc) · 2.54 KB
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# Makefile for TazUSB.
# Check the README for more information.
#
PREFIX?=/usr
DOCDIR?=/usr/share/doc
DESTDIR?=
LINGUAS?=el fr it ja pl pt_BR ru vi zh_CN zh_TW
PACKAGE = tazusb
VERSION := $(shell grep ^VERSION ${PACKAGE} | cut -d '=' -f 2)
TARBALL = $(PACKAGE)-$(VERSION).tar.gz
all:
# i18n.
pot:
xgettext -o po/tazusb-box/tazusb-box.pot -L Shell \
--package-name="TazUSB" \
--package-version="$(VERSION)" \
-kaction -ktitle -k_ -k_n -k_p:1,2 \
./tazusb-box
xgettext -o po/tazusb/tazusb.pot -L Shell \
--package-name="TazUSB" \
-kaction -ktitle -k_ -k_n -k_p:1,2 \
--package-version="$(VERSION)" \
./tazusb
msgmerge:
@for l in $(LINGUAS); do \
if [ -f "po/tazusb-box/$$l.po" ]; then \
echo -n "Updating $$l po file."; \
msgmerge -U po/tazusb-box/$$l.po po/tazusb-box/tazusb-box.pot ; \
fi;\
if [ -f "po/tazusb/$$l.po" ]; then \
echo -n "Updating $$l po file."; \
msgmerge -U po/tazusb/$$l.po po/tazusb/tazusb.pot ; \
fi;\
done;
msgfmt:
@for l in $(LINGUAS); do \
if [ -f "po/tazusb-box/$$l.po" ]; then \
echo "Compiling tazusb-box $$l mo file..."; \
mkdir -p po/mo/$$l/LC_MESSAGES; \
msgfmt -o po/mo/$$l/LC_MESSAGES/tazusb-box.mo po/tazusb-box/$$l.po ; \
fi;\
if [ -f "po/tazusb/$$l.po" ]; then \
echo "Compiling tazusb $$l mo file..."; \
mkdir -p po/mo/$$l/LC_MESSAGES; \
msgfmt -o po/mo/$$l/LC_MESSAGES/tazusb.mo po/tazusb/$$l.po ; \
fi;\
done;
# Installation.
install: msgfmt
@echo "Installing TazUSB into $(DESTDIR)$(PREFIX)/bin..."
mkdir -p $(DESTDIR)$(PREFIX)/bin
install -m 0755 tazusb $(DESTDIR)$(PREFIX)/bin
-[ "$(VERSION)" ] && sed -i 's/^VERSION=[0-9].*/VERSION=$(VERSION)/' $(DESTDIR)$(PREFIX)/bin/tazusb
install -m 0755 tazusb-box $(DESTDIR)$(PREFIX)/bin
@echo "Installing Tazusb documentation..."
mkdir -p $(DESTDIR)$(DOCDIR)/tazusb
cp -a doc/* $(DESTDIR)$(DOCDIR)/tazusb
# i18n
mkdir -p $(DESTDIR)$(PREFIX)/share/locale
cp -a po/mo/* $(DESTDIR)$(PREFIX)/share/locale
# Desktop integration
@echo "Setting up desktop integration..."
mkdir -p $(DESTDIR)$(PREFIX)/share
cp -a applications $(DESTDIR)$(PREFIX)/share
# Uninstallation and tarball clean-up commands.
uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/tazusb
rm -f $(DESTDIR)$(PREFIX)/bin/tazusb-box
rm -rf $(DESTDIR)$(DOCDIR)/tazusb
rm -rf $(DESTDIR)$(PREFIX)/share/locale/*/LC_MESSAGES/tazusb*.mo
clean:
rm -rf _pkg
rm -rf po/mo
rm -f po/*/*~
dist-clean:
rm -rf $(DISTDIR)
rm -f $(DISTDIR).*
# Build tarball and MD5 file for packaging.
dist: dist-clean
hg archive -t tgz $(TARBALL)
md5sum $(TARBALL) > $(PACKAGE)-$(VERSION).md5