tazusb view Makefile @ rev 92

Fix: POT and fr.po. Change Makefile for tazusb
author Eric Joseph-Alexandre <erjo@slitaz.org>
date Wed Aug 31 12:15:38 2011 +0200 (2011-08-31)
parents b7bdee64a948
children 8ee01a845cce
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?=fr pt
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/tazusbbox/tazusbbox.pot -L Shell \
19 --package-name="TazUSB" \
20 --package-version="$(VERSION)" \
21 ./tazusbbox
22 xgettext -o po/tazusb/tazusb.pot -L Shell \
23 --package-name="TazUSB" \
24 --package-version="$(VERSION)" \
25 ./tazusb
27 msgmerge:
28 @for l in $(LINGUAS); do \
29 if [ -f "po/tazusbbox/$$l.po" ]; then \
30 echo -n "Updating $$l po file."; \
31 msgmerge -U po/tazusbbox/$$l.po po/tazusbbox/tazusbbox.pot ; \
32 fi;\
33 if [ -f "po/tazusb/$$l.po" ]; then \
34 echo -n "Updating $$l po file."; \
35 msgmerge -U po/tazusb/$$l.po po/tazusb/tazusb.pot ; \
36 fi;\
37 done;
39 msgfmt:
40 @for l in $(LINGUAS); do \
41 if [ -f "po/tazusbbox/$$l.po" ]; then \
42 echo "Compiling tazusbbox $$l mo file..."; \
43 mkdir -p po/mo/$$l/LC_MESSAGES; \
44 msgfmt -o po/mo/$$l/LC_MESSAGES/tazusbbox.mo po/tazusbbox/$$l.po ; \
45 fi;\
46 if [ -f "po/tazusb/$$l.po" ]; then \
47 echo "Compiling tazusb $$l mo file..."; \
48 mkdir -p po/mo/$$l/LC_MESSAGES; \
49 msgfmt -o po/mo/$$l/LC_MESSAGES/tazusb.mo po/tazusb/$$l.po ; \
50 fi;\
51 done;
53 # Installation.
55 install: msgfmt
56 @echo "Installing TazUSB into $(DESTDIR)$(PREFIX)/bin..."
57 mkdir -p $(DESTDIR)$(PREFIX)/bin
58 install -m 0755 tazusb $(DESTDIR)$(PREFIX)/bin
59 install -m 0755 tazusbbox $(DESTDIR)$(PREFIX)/bin
60 @echo "Installing Tazusb documentation..."
61 mkdir -p $(DESTDIR)$(DOCDIR)/tazusb
62 cp -a doc/* $(DESTDIR)$(DOCDIR)/tazusb
63 # i18n
64 mkdir -p $(DESTDIR)$(PREFIX)/share/locale
65 cp -a po/mo/* $(DESTDIR)$(PREFIX)/share/locale
66 # Desktop integration
67 @echo "Setting up desktop integration..."
68 mkdir -p $(DESTDIR)$(PREFIX)/share
69 cp -a applications $(DESTDIR)$(PREFIX)/share
71 # Uninstallation and tarball clean-up commands.
73 uninstall:
74 rm -f $(DESTDIR)$(PREFIX)/bin/tazusb
75 rm -f $(DESTDIR)$(PREFIX)/bin/tazusbbox
76 rm -rf $(DESTDIR)$(DOCDIR)/tazusb
77 rm -rf $(DESTDIR)$(PREFIX)/share/locale/*/LC_MESSAGES/tazusb*.mo
79 clean:
80 rm -rf _pkg
81 rm -rf po/mo
82 rm -f po/*/*~
84 dist-clean:
85 rm -rf $(DISTDIR)
86 rm -f $(DISTDIR).*
88 # Build tarball and MD5 file for packaging.
89 dist: dist-clean
90 hg archive -t tgz $(TARBALL)
91 md5sum $(TARBALL) > $(PACKAGE)-$(VERSION).md5