Debian Codegraph @

po/Makefile

raw
1 INSTALL=install -c
2 INSTALL_PROGRAM= ${INSTALL}
3 INSTALL_DATA= ${INSTALL} -m 644
4 INSTALLNLSDIR=${BASEDIR}/usr/share/locale
5
6 TUPDATE = msgmerge
7
8 NLSPACKAGE = net-tools
9
10 -include ../config.make
11 ALL_POS = $(wildcard *.po)
12 ALL_LANGS = $(ALL_POS:%.po=%)
13 ALL_CATALOGS = $(ALL_LANGS:%=%.mo)
14 ifeq ($(I18N),1)
15 ifeq ($(LINGUAS),)
16 LANGS = $(ALL_LANGS)
17 else
18 LANGS = $(filter $(LINGUAS),$(ALL_LANGS))
19 endif
20 else
21 LANGS =
22 endif
23 CATALOGS = $(LANGS:%=%.mo)
24
25 POTFILES=../arp.c ../hostname.c ../ifconfig.c ../netstat.c ../rarp.c \
26 ../route.c ../plipconfig.c ../iptunnel.c ../statistics.c \
27 ../lib/activate.c ../lib/af.c ../lib/arcnet.c ../lib/ash.c \
28 ../lib/ax25.c ../lib/ax25_gr.c ../lib/ddp.c ../lib/ddp_gr.c \
29 ../lib/econet.c ../lib/ether.c ../lib/fddi.c ../lib/frame.c \
30 ../lib/getargs.c ../lib/getroute.c ../lib/hdlclapb.c ../lib/hippi.c \
31 ../lib/hw.c ../lib/inet.c ../lib/inet6.c ../lib/inet6_gr.c \
32 ../lib/inet6_sr.c ../lib/inet_gr.c ../lib/inet_sr.c ../lib/ipx.c \
33 ../lib/ipx_gr.c ../lib/ipx_sr.c ../lib/loopback.c ../lib/masq_info.c \
34 ../lib/nstrcmp.c ../lib/netrom.c ../lib/netrom_gr.c ../lib/netrom_sr.c \
35 ../lib/ppp.c ../lib/ppp_ac.c ../lib/proc.c ../lib/rose.c \
36 ../lib/rose_gr.c ../lib/setroute.c ../lib/sit.c ../lib/slip.c \
37 ../lib/slip_ac.c ../lib/tr.c ../lib/tunnel.c ../lib/unix.c \
38 ../lib/util.c ../lib/interface.c ../lib/sockets.c ../lib/util-ank.c \
39 ../ipmaddr.c ../slattach.c ../iptunnel.c
40
41 all: $(NLSPACKAGE).pot $(CATALOGS)
42
43 $(NLSPACKAGE).pot: $(POTFILES)
44 xgettext --default-domain=$(NLSPACKAGE) \
45 --add-comments --keyword=_ --keyword=N_ $(POTFILES)
46 if cmp -s $(NLSPACKAGE).po $(NLSPACKAGE).pot; then \
47 rm -f -- $(NLSPACKAGE).po; \
48 else \
49 mv $(NLSPACKAGE).po $(NLSPACKAGE).pot; \
50 fi
51
52
53 update-po: Makefile
54 $(MAKE) $(NLSPACKAGE).pot
55 langs='$(ALL_LANGS)'; \
56 for lang in $$langs; do \
57 cat=$$lang.mo; \
58 mv $$lang.po $$lang.old.po; \
59 echo "$$lang:"; \
60 if $(TUPDATE) $$lang.old.po $(NLSPACKAGE).pot > $$lang.po; then \
61 rm -f -- $$lang.old.po; \
62 else \
63 echo "tupdate for $$cat failed!"; \
64 rm -f -- $$lang.po; \
65 mv $$lang.old.po $$lang.po; \
66 fi; \
67 done
68
69 clean:
70 rm -f -- *mo
71
72 dist: $(ALL_CATALOGS)
73
74 distclean: clean
75 rm -f -- .depend Makefile
76
77 depend:
78
79 install: $(CATALOGS)
80 langs='$(LANGS)'; \
81 for l in $$langs; do \
82 $(INSTALL) -m 755 -d $(INSTALLNLSDIR)/$$l; \
83 $(INSTALL) -m 755 -d $(INSTALLNLSDIR)/$$l/LC_MESSAGES; \
84 $(INSTALL) -m 644 $$l.mo $(INSTALLNLSDIR)/$$l/LC_MESSAGES/net-tools.mo; \
85 done
86
87 %.mo: %.po
88 msgfmt -o $@ $<