slitaz-tools view Makefile @ rev 662

tazinst: fix Makefile errors on po files
author Dominique Corbex <domcox@slitaz.org>
date Sat Aug 06 21:19:23 2011 +0200 (2011-08-06)
parents 94b6f4af84be
children 2b69f8b15b5a
line source
1 # Makefile for SliTaz tools.
2 # Check the README for more information.
3 #
4 PREFIX?=/usr
5 DOCDIR?=/usr/share/doc
6 DESTDIR?=
8 PROJECTS=slitaz-tools slitaz-boxes tazbox tazinst tazdrop
9 LINGUAS=fr pt_BR
11 all: msgfmt
13 help:
14 @echo ""
15 @echo "make: pot msgmerge msgfmt install install-boxes clean"
16 @echo ""
18 # i18n.
20 tools-pot:
21 @echo -n "Generating SliTaz Tools pot file... "
22 @xgettext -o po/slitaz-tools/slitaz-tools.pot -L Shell \
23 --package-name="SliTaz Tools" \
24 ./tinyutils/tazlocale ./tinyutils/tazkeymap ./tinyutils/setmixer \
25 ./tinyutils/tazx
26 @echo "done"
28 boxes-pot:
29 @echo -n "Generating SliTaz Boxes pot file... "
30 @xgettext -o po/slitaz-boxes/slitaz-boxes.pot -L Shell \
31 --package-name="SliTaz Boxes" \
32 ./tinyutils/scpbox
33 @echo "done"
35 tazbox-pot:
36 @echo -n "Generating tazbox pot file... "
37 @xgettext -o po/tazbox/tazbox.pot -L Shell \
38 --package-name="TazBox" ./tazbox/tazbox
39 @echo "done"
41 tazdrop-pot:
42 @echo -n "Generating tazdrop pot file... "
43 @xgettext -o po/tazdrop/tazdrop.pot -L Shell \
44 --package-name="TazDrop" ./tazdrop/tazdrop
45 @echo "done"
47 tazinst-pot:
48 @echo -n "Generating tazinst pot file... "
49 @xgettext -o po/tazinst/tazinst.pot -L Shell \
50 --package-name="Tazinst" ./installer/tazinst
51 @echo "done"
53 pot: tools-pot boxes-pot tazbox-pot tazdrop-pot tazinst-pot
55 msgmerge:
56 @for p in $(PROJECTS); do \
57 for l in $(LINGUAS); do \
58 echo -en "\rUpdating $$p $$l po file."; \
59 [ -f "po/$$p/$$l.po" ] && \
60 msgmerge -U po/$$p/$$l.po po/$$p/$$p.pot; \
61 done; \
62 done;
64 msgfmt:
65 @for p in $(PROJECTS); do \
66 for l in $(LINGUAS); do \
67 [ -f "po/$$p/$$l.po" ] && \
68 echo -n "Compiling $$p $$l mo file... " && \
69 mkdir -p po/mo/$$l && \
70 msgfmt -o po/mo/$$l/$$p.mo po/$$p/$$l.po && \
71 echo "done"; \
72 done; \
73 done;
75 # Installation
77 install:
78 install -m 0777 -d $(DESTDIR)/sbin
79 install -m 0777 -d $(DESTDIR)/etc/X11
80 install -m 0777 -d $(DESTDIR)$(PREFIX)/bin
81 install -m 0777 -d $(DESTDIR)$(PREFIX)/sbin
82 install -m 0777 -d $(DESTDIR)$(PREFIX)/share
83 cp -a rootfs/etc $(DESTDIR)/
84 chmod +x $(DESTDIR)/etc/init.d/*
85 cp -a rootfs/usr/share/licenses $(DESTDIR)$(PREFIX)/share
86 # /sbin tools.
87 for i in tazlocale tazkeymap tazhw hwsetup; do \
88 install -m 0755 tinyutils/$$i $(DESTDIR)/sbin; \
89 done;
90 # Declare all config files.
91 for file in etc/locale.conf etc/keymap.conf etc/TZ etc/X11/screen.conf; \
92 do \
93 touch $(DESTDIR)/$$file; \
94 done;
95 # /usr/bin tools.
96 for app in tazx startx history editor browser terminal file-manager; \
97 do \
98 install -m 0755 tinyutils/$$app $(DESTDIR)$(PREFIX)/bin; \
99 done;
100 # /usr/sbin sound tools.
101 install -m 0755 tinyutils/soundconf $(DESTDIR)$(PREFIX)/sbin
102 install -m 0755 tinyutils/setmixer $(DESTDIR)$(PREFIX)/sbin
103 # Installer's
104 install -m 0777 -d $(DESTDIR)$(PREFIX)/share/slitaz/messages/en
105 install -m 0755 installer/slitaz-installer $(DESTDIR)$(PREFIX)/bin
106 install -m 0644 messages/en/installer.msg \
107 $(DESTDIR)$(PREFIX)/share/slitaz/messages/en
108 # tazinst
109 install -m 0755 installer/tazinst $(DESTDIR)$(PREFIX)/bin
110 for l in fr; \
111 do \
112 install -m 0777 -d $(DESTDIR)$(PREFIX)/share/locale/$$l/LC_MESSAGES; \
113 install -m 0644 po/mo/$$l/tazinst.mo \
114 $(DESTDIR)$(PREFIX)/share/locale/$$l/LC_MESSAGES; \
115 done;
116 # slitaz-tools i18n
117 for l in $(LINGUAS); \
118 do \
119 install -m 0777 -d $(DESTDIR)$(PREFIX)/share/locale/$$l/LC_MESSAGES; \
120 install -m 0644 po/mo/$$l/slitaz-tools.mo \
121 $(DESTDIR)$(PREFIX)/share/locale/$$l/LC_MESSAGES; \
122 done;
124 install-boxes:
125 install -m 0777 -d $(DESTDIR)/etc/wireless
126 install -m 0777 -d $(DESTDIR)$(PREFIX)/bin
127 install -m 0777 -d $(DESTDIR)$(PREFIX)/lib/slitaz
128 install -m 0777 -d $(DESTDIR)$(PREFIX)/share/locale
129 install -m 0777 -d $(DESTDIR)$(PREFIX)/share/applications
130 install -m 0777 -d $(DESTDIR)$(PREFIX)/share/pixmaps
131 install -m 0777 -d $(DESTDIR)$(PREFIX)/share/doc
132 install -m 0755 tinyutils/*box $(DESTDIR)$(PREFIX)/bin
133 install -m 0755 tazbox/tazbox $(DESTDIR)$(PREFIX)/bin
134 # Libs
135 install -m 0755 lib/[a-z]* $(DESTDIR)$(PREFIX)/lib/slitaz
136 # Desktop files, icons and doc.
137 install -m 0644 rootfs/usr/share/applications/* \
138 $(DESTDIR)$(PREFIX)/share/applications
139 install -m 0644 rootfs/usr/share/pixmaps/* \
140 $(DESTDIR)$(PREFIX)/share/pixmaps
141 cp -a doc $(DESTDIR)$(PREFIX)/share/doc/slitaz-tools
142 # i18n.
143 for l in $(LINGUAS); \
144 do \
145 install -m 0777 -d $(DESTDIR)$(PREFIX)/share/locale/$$l/LC_MESSAGES; \
146 install -m 0644 po/mo/$$l/*box* \
147 $(DESTDIR)$(PREFIX)/share/locale/$$l/LC_MESSAGES; \
148 done;
149 # Default English messages (will move to po)
150 install -m 0777 -d $(DESTDIR)$(PREFIX)/share/slitaz/messages/en
151 install -m 0644 messages/en/desktopbox.msg \
152 $(DESTDIR)$(PREFIX)/share/slitaz/messages/en
153 # Gksu fake for pcmanfm.
154 cd $(DESTDIR)$(PREFIX)/bin && ln -s subox gksu
156 clean:
157 rm -rf po/mo
158 rm -f po/*/*.po~