tazusb view Makefile @ rev 183
tazusb: ext4 support
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Thu Feb 04 12:45:09 2016 +0100 (2016-02-04) |
parents | e7c0b341964e |
children | f61bff344902 |
line source
1 # Makefile for TazUSB.
2 # Check the README for more information.
3 #
4 PREFIX?=/usr
5 DOCDIR?=/usr/share/doc
6 DESTDIR?=
7 LINGUAS?=el fr pl pt_BR ru zh_CN zh_TW
9 PACKAGE = tazusb
10 VERSION := $(shell grep ^VERSION ${PACKAGE} | cut -d '=' -f 2)
11 TARBALL = $(PACKAGE)-$(VERSION).tar.gz
13 all:
15 # i18n.
17 pot:
18 xgettext -o po/tazusb-box/tazusb-box.pot -L Shell \
19 --package-name="TazUSB" \
20 --package-version="$(VERSION)" \
21 -kaction -ktitle -k_ -k_n -k_p:1,2 \
22 ./tazusb-box
23 xgettext -o po/tazusb/tazusb.pot -L Shell \
24 --package-name="TazUSB" \
25 -kaction -ktitle -k_ -k_n -k_p:1,2 \
26 --package-version="$(VERSION)" \
27 ./tazusb
29 msgmerge:
30 @for l in $(LINGUAS); do \
31 if [ -f "po/tazusb-box/$$l.po" ]; then \
32 echo -n "Updating $$l po file."; \
33 msgmerge -U po/tazusb-box/$$l.po po/tazusb-box/tazusb-box.pot ; \
34 fi;\
35 if [ -f "po/tazusb/$$l.po" ]; then \
36 echo -n "Updating $$l po file."; \
37 msgmerge -U po/tazusb/$$l.po po/tazusb/tazusb.pot ; \
38 fi;\
39 done;
41 msgfmt:
42 @for l in $(LINGUAS); do \
43 if [ -f "po/tazusb-box/$$l.po" ]; then \
44 echo "Compiling tazusb-box $$l mo file..."; \
45 mkdir -p po/mo/$$l/LC_MESSAGES; \
46 msgfmt -o po/mo/$$l/LC_MESSAGES/tazusb-box.mo po/tazusb-box/$$l.po ; \
47 fi;\
48 if [ -f "po/tazusb/$$l.po" ]; then \
49 echo "Compiling tazusb $$l mo file..."; \
50 mkdir -p po/mo/$$l/LC_MESSAGES; \
51 msgfmt -o po/mo/$$l/LC_MESSAGES/tazusb.mo po/tazusb/$$l.po ; \
52 fi;\
53 done;
55 # Installation.
57 install: msgfmt
58 @echo "Installing TazUSB into $(DESTDIR)$(PREFIX)/bin..."
59 mkdir -p $(DESTDIR)$(PREFIX)/bin
60 install -m 0755 tazusb $(DESTDIR)$(PREFIX)/bin
61 -[ "$(VERSION)" ] && sed -i 's/^VERSION=[0-9].*/VERSION=$(VERSION)/' $(DESTDIR)$(PREFIX)/bin/tazusb
62 install -m 0755 tazusb-box $(DESTDIR)$(PREFIX)/bin
63 @echo "Installing Tazusb documentation..."
64 mkdir -p $(DESTDIR)$(DOCDIR)/tazusb
65 cp -a doc/* $(DESTDIR)$(DOCDIR)/tazusb
66 # i18n
67 mkdir -p $(DESTDIR)$(PREFIX)/share/locale
68 cp -a po/mo/* $(DESTDIR)$(PREFIX)/share/locale
69 # Desktop integration
70 @echo "Setting up desktop integration..."
71 mkdir -p $(DESTDIR)$(PREFIX)/share
72 cp -a applications $(DESTDIR)$(PREFIX)/share
74 # Uninstallation and tarball clean-up commands.
76 uninstall:
77 rm -f $(DESTDIR)$(PREFIX)/bin/tazusb
78 rm -f $(DESTDIR)$(PREFIX)/bin/tazusb-box
79 rm -rf $(DESTDIR)$(DOCDIR)/tazusb
80 rm -rf $(DESTDIR)$(PREFIX)/share/locale/*/LC_MESSAGES/tazusb*.mo
82 clean:
83 rm -rf _pkg
84 rm -rf po/mo
85 rm -f po/*/*~
87 dist-clean:
88 rm -rf $(DISTDIR)
89 rm -f $(DISTDIR).*
91 # Build tarball and MD5 file for packaging.
92 dist: dist-clean
93 hg archive -t tgz $(TARBALL)
94 md5sum $(TARBALL) > $(PACKAGE)-$(VERSION).md5