aboutsummaryrefslogtreecommitdiff
blob: 026a5dfdb653d4f71a3a3192fa3c6f18c46267d2 (plain)
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
INSTALL= /usr/bin/install -c
INSTALL_PROGRAM= ${INSTALL}
INSTALL_DATA= ${INSTALL} -m 644
INSTALLNLSDIR=${BASEDIR}/usr/share/locale

TUPDATE = tupdate

NLSPACKAGE = net-tools

CATALOGS = de.mo pt_BR.mo

POTFILES=../arp.c ../hostname.c ../ifconfig.c ../rarp.c \
	../lib/ax25.c ../lib/activate.c ../lib/af.c \
	../lib/arcnet.c ../lib/econet.c ../lib/ax25_gr.c \
	../lib/ddp.c ../lib/ddp_gr.c ../lib/ether.c \
	../lib/fddi.c ../lib/getroute.c ../lib/hw.c ../lib/inet.c \
	../lib/inet6.c ../lib/inet6_gr.c ../lib/inet6_sr.c \
	../lib/inet_gr.c ../lib/inet_sr.c ../lib/ipx.c \
	../lib/ipx_gr.c ../lib/loopback.c ../lib/masq_info.c \
	../lib/netrom.c ../lib/netrom_gr.c ../lib/netrom_sr.c \
	../lib/ppp.c ../lib/ppp_ac.c ../lib/rose.c ../lib/rose_gr.c \
	../lib/setroute.c ../lib/tr.c ../lib/unix.c ../netstat.c \
	../route.c ../sockets.c ../statistics.c

all: $(NLSPACKAGE).pot $(CATALOGS)

$(NLSPACKAGE).pot: $(POTFILES)
	xgettext --default-domain=$(NLSPACKAGE) \
       	  --add-comments --keyword=_ --keyword=N_ $(POTFILES)
	if cmp -s $(NLSPACKAGE).po $(NLSPACKAGE).pot; then \
	    rm -f $(NLSPACKAGE).po; \
	else \
	    mv $(NLSPACKAGE).po $(NLSPACKAGE).pot; \
	fi


update-po: Makefile
	$(MAKE) $(NLSPACKAGE).pot
	catalogs='$(CATALOGS)'; \
	for cat in $$catalogs; do \
		lang=`echo $$cat | sed 's/.mo//'`; \
		mv $$lang.po $$lang.old.po; \
		echo "$$lang:"; \
		if $(TUPDATE) $(NLSPACKAGE).pot $$lang.old.po > $$lang.po; then \
		rm -f $$lang.old.po; \
	else \
    		echo "tupdate for $$cat failed!"; \
		rm -f $$lang.po; \
		mv $$lang.old.po $$lang.po; \
	fi; \
	done

clean:
	rm -f *mo

distclean: clean
	rm -f .depend Makefile

depend:

install: $(CATALOGS)
	for n in $(CATALOGS); do \
	    l=`basename $$n .mo`; \
	    $(INSTALL) -m 755 -d $(INSTALLNLSDIR)/$$l; \
	    $(INSTALL) -m 755 -d $(INSTALLNLSDIR)/$$l/LC_MESSAGES; \
	    $(INSTALL) -m 644 $$n $(INSTALLNLSDIR)/$$l/LC_MESSAGES/net-tools.mo; \
	done

%.mo: %.po
	msgfmt -o $@ $<