1# Makefile for program source directory in GNU NLS utilities package.
2# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
3# Copyright (C) 2004-2008 Rodney Dawes <dobey.pwns@gmail.com>
4#
5# This file may be copied and used freely without restrictions.  It may
6# be used in projects which are not available under a GNU Public License,
7# but which still want to provide support for the GNU gettext functionality.
8#
9# - Modified by Owen Taylor <otaylor@redhat.com> to use GETTEXT_PACKAGE
10#   instead of PACKAGE and to look for po2tbl in ./ not in intl/
11#
12# - Modified by jacob berkman <jacob@ximian.com> to install
13#   Makefile.in.in and po2tbl.sed.in for use with glib-gettextize
14#
15# - Modified by Rodney Dawes <dobey.pwns@gmail.com> for use with intltool
16#
17# We have the following line for use by intltoolize:
18# INTLTOOL_MAKEFILE
19
20GETTEXT_PACKAGE = avahi
21PACKAGE = avahi
22VERSION = 0.6.25
23
24SHELL = /bin/sh
25
26srcdir = .
27top_srcdir = ..
28top_builddir = ..
29
30
31prefix = /usr
32exec_prefix = ${prefix}
33datadir = ${datarootdir}
34datarootdir = ${prefix}/share
35libdir = ${exec_prefix}/lib
36DATADIRNAME = lib
37itlocaledir = $(prefix)/$(DATADIRNAME)/locale
38subdir = po
39install_sh = $(SHELL) $(SRC_PATH)/avahi-0.6.25/install-sh
40# Automake >= 1.8 provides /bin/mkdir -p.
41# Until it can be supposed, use the safe fallback:
42mkdir_p = $(install_sh) -d
43
44INSTALL = /usr/bin/install -c
45INSTALL_DATA = ${INSTALL} -m 644
46
47GMSGFMT = /usr/bin/msgfmt
48MSGFMT = /usr/bin/msgfmt
49XGETTEXT = :
50INTLTOOL_UPDATE = /usr/bin/intltool-update
51INTLTOOL_EXTRACT = /usr/bin/intltool-extract
52MSGMERGE = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist
53GENPOT   = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --pot
54
55ALL_LINGUAS = 
56
57PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; else echo "$(ALL_LINGUAS)"; fi)
58
59USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep '^$$lang$$' $(srcdir)/LINGUAS 2>/dev/null`" -o -n "`echo $$ALINGUAS|tr ' ' '\n'|grep '^$$lang$$'`"; then printf "$$lang "; fi; done; fi)
60
61USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)" -o -n "$(LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done)
62
63POFILES=$(shell LINGUAS="$(PO_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.po "; done)
64
65DISTFILES = Makefile.in.in POTFILES.in $(POFILES)
66EXTRA_DISTFILES = ChangeLog POTFILES.skip Makevars LINGUAS
67
68POTFILES = \
69	../avahi-common/error.c \
70	../avahi-discover-standalone/avahi-discover.glade \
71	../avahi-python/avahi-discover/avahi-discover.desktop.in.in \
72	../avahi-ui/avahi-ui.c \
73	../avahi-ui/bssh.c \
74	../avahi-ui/bssh.desktop.in.in \
75	../avahi-ui/bvnc.desktop.in.in \
76	../avahi-utils/avahi-browse.c \
77	../avahi-utils/avahi-publish.c \
78	../avahi-utils/avahi-resolve.c \
79	../avahi-utils/avahi-set-host-name.c
80
81CATALOGS=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.gmo "; done)
82
83.SUFFIXES:
84.SUFFIXES: .po .pox .gmo .mo .msg .cat
85
86.po.pox:
87	$(MAKE) $(GETTEXT_PACKAGE).pot
88	$(MSGMERGE) $< $(GETTEXT_PACKAGE).pot -o $*.pox
89
90.po.mo:
91	$(MSGFMT) -o $@ $<
92
93.po.gmo:
94	file=`echo $* | sed 's,.*/,,'`.gmo \
95	  && rm -f $$file && $(GMSGFMT) -o $$file $<
96
97.po.cat:
98	sed -f ../intl/po2msg.sed < $< > $*.msg \
99	  && rm -f $@ && gencat $@ $*.msg
100
101
102all: all-yes
103
104all-yes: $(CATALOGS)
105all-no:
106
107$(GETTEXT_PACKAGE).pot: $(POTFILES)
108	$(GENPOT)
109
110install: install-data
111install-data: install-data-yes
112install-data-no: all
113install-data-yes: all
114	linguas="$(USE_LINGUAS)"; \
115	for lang in $$linguas; do \
116	  dir=$(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES; \
117	  $(mkdir_p) $$dir; \
118	  if test -r $$lang.gmo; then \
119	    $(INSTALL_DATA) $$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \
120	    echo "installing $$lang.gmo as $$dir/$(GETTEXT_PACKAGE).mo"; \
121	  else \
122	    $(INSTALL_DATA) $(srcdir)/$$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \
123	    echo "installing $(srcdir)/$$lang.gmo as" \
124		 "$$dir/$(GETTEXT_PACKAGE).mo"; \
125	  fi; \
126	  if test -r $$lang.gmo.m; then \
127	    $(INSTALL_DATA) $$lang.gmo.m $$dir/$(GETTEXT_PACKAGE).mo.m; \
128	    echo "installing $$lang.gmo.m as $$dir/$(GETTEXT_PACKAGE).mo.m"; \
129	  else \
130	    if test -r $(srcdir)/$$lang.gmo.m ; then \
131	      $(INSTALL_DATA) $(srcdir)/$$lang.gmo.m \
132		$$dir/$(GETTEXT_PACKAGE).mo.m; \
133	      echo "installing $(srcdir)/$$lang.gmo.m as" \
134		   "$$dir/$(GETTEXT_PACKAGE).mo.m"; \
135	    else \
136	      true; \
137	    fi; \
138	  fi; \
139	done
140
141# Empty stubs to satisfy archaic automake needs
142dvi info tags TAGS ID:
143
144# Define this as empty until I found a useful application.
145install-exec installcheck:
146
147uninstall:
148	linguas="$(USE_LINGUAS)"; \
149	for lang in $$linguas; do \
150	  rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo; \
151	  rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo.m; \
152	done
153
154check: all $(GETTEXT_PACKAGE).pot
155	rm -f missing notexist
156	srcdir=$(srcdir) $(INTLTOOL_UPDATE) -m
157	if [ -r missing -o -r notexist ]; then \
158	  exit 1; \
159	fi
160
161mostlyclean:
162	rm -f *.pox $(GETTEXT_PACKAGE).pot *.old.po cat-id-tbl.tmp
163	rm -f .intltool-merge-cache
164
165clean: mostlyclean
166
167distclean: clean
168	rm -f Makefile Makefile.in POTFILES stamp-it
169	rm -f *.mo *.msg *.cat *.cat.m *.gmo
170
171maintainer-clean: distclean
172	@echo "This command is intended for maintainers to use;"
173	@echo "it deletes files that may require special tools to rebuild."
174	rm -f Makefile.in.in
175
176distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
177dist distdir: $(DISTFILES)
178	dists="$(DISTFILES)"; \
179	extra_dists="$(EXTRA_DISTFILES)"; \
180	for file in $$extra_dists; do \
181	  test -f $(srcdir)/$$file && dists="$$dists $(srcdir)/$$file"; \
182	done; \
183	for file in $$dists; do \
184	  test -f $$file || file="$(srcdir)/$$file"; \
185	  ln $$file $(distdir) 2> /dev/null \
186	    || cp -p $$file $(distdir); \
187	done
188
189update-po: Makefile
190	$(MAKE) $(GETTEXT_PACKAGE).pot
191	tmpdir=`pwd`; \
192	linguas="$(USE_LINGUAS)"; \
193	for lang in $$linguas; do \
194	  echo "$$lang:"; \
195	  result="`$(MSGMERGE) -o $$tmpdir/$$lang.new.po $$lang`"; \
196	  if $$result; then \
197	    if cmp $(srcdir)/$$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
198	      rm -f $$tmpdir/$$lang.new.po; \
199            else \
200	      if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
201	        :; \
202	      else \
203	        echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
204	        rm -f $$tmpdir/$$lang.new.po; \
205	        exit 1; \
206	      fi; \
207	    fi; \
208	  else \
209	    echo "msgmerge for $$lang.gmo failed!"; \
210	    rm -f $$tmpdir/$$lang.new.po; \
211	  fi; \
212	done
213
214Makefile POTFILES: stamp-it
215	@if test ! -f $@; then \
216	  rm -f stamp-it; \
217	  $(MAKE) stamp-it; \
218	fi
219
220stamp-it: Makefile.in.in $(top_builddir)/config.status POTFILES.in
221	cd $(top_builddir) \
222	  && CONFIG_FILES=$(subdir)/Makefile.in CONFIG_HEADERS= CONFIG_LINKS= \
223	       $(SHELL) ./config.status
224
225# Tell versions [3.59,3.63) of GNU make not to export all variables.
226# Otherwise a system limit (for SysV at least) may be exceeded.
227.NOEXPORT:
228