1 # Makefile for program source directory in GNU NLS utilities package.
2 # Copyright (C) 1995-1997, 2000, 2001 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
4 # This file file be copied and used freely without restrictions. It can
5 # be used in projects which are not available under the GNU Public License
6 # but which still want to provide support for the GNU gettext functionality.
7 # Please note that the actual code is *not* freely available.
9 PACKAGE = freeciv-nations
12 # These two variables depend on the location of this directory.
13 subdir = translations/nations
20 top_srcdir = @top_srcdir@
24 exec_prefix = @exec_prefix@
25 datarootdir = @datarootdir@
27 localedir = @localedir@
28 gettextsrcdir = $(datadir)/gettext/po
31 INSTALL_DATA = @INSTALL_DATA@
32 MKINSTALLDIRS = @MKINSTALLDIRS@
33 mkinstalldirs = @MKDIR_P@
45 INCLUDES = -I.. -I$(top_srcdir)/intl
47 COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
52 # Keep this in one line, since configure replaces it when NLS disabled
53 DISTFILES = Makefile.in.in POTFILES.in POTFILES.skip $(PACKAGE).pot $(POFILES) $(GMOFILES)
60 .SUFFIXES: .c .o .po .pox .gmo .mo
66 $(MAKE) $(PACKAGE).pot
67 $(MSGMERGE) $< $(srcdir)/$(PACKAGE).pot -o $*.pox
73 file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \
74 && rm -f $$file && $(GMSGFMT) -c --statistics -o $$file $<
82 # Note: Target 'all' must not depend on target '$(srcdir)/$(PACKAGE).pot',
83 # otherwise packages like GCC can not be built if only parts of the source
84 # have been downloaded.
86 $(srcdir)/$(PACKAGE).pot: $(POTFILES) $(srcdir)/POTFILES.in
87 $(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \
88 --add-comments --keyword=_ --keyword=N_ \
89 --files-from=$(srcdir)/POTFILES.in \
90 && test ! -f $(PACKAGE).po \
91 || ( rm -f $(srcdir)/$(PACKAGE).pot \
92 && mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot )
95 install: install-exec install-data
97 install-data: install-data-@USE_NLS@
98 if test "$(PACKAGE)" = "gettext"; then \
99 $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
100 $(INSTALL_DATA) $(srcdir)/Makefile.in.in \
101 $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
106 install-data-yes: all
107 $(mkinstalldirs) $(DESTDIR)$(datadir)
108 @catalogs='$(CATALOGS)'; \
109 for cat in $$catalogs; do \
110 cat=`basename $$cat`; \
111 lang=`echo $$cat | sed 's/\.gmo$$//'`; \
112 dir=$(localedir)/$$lang/LC_MESSAGES; \
113 $(mkinstalldirs) $(DESTDIR)$$dir; \
114 if test -r $$cat; then \
115 $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
116 echo "installing $$cat as $(DESTDIR)$$dir/$(PACKAGE).mo"; \
118 $(INSTALL_DATA) $(srcdir)/$$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
119 echo "installing $(srcdir)/$$cat as" \
120 "$(DESTDIR)$$dir/$(PACKAGE).mo"; \
124 # Define this as empty until I found a useful application.
128 catalogs='$(CATALOGS)'; \
129 for cat in $$catalogs; do \
130 cat=`basename $$cat`; \
131 lang=`echo $$cat | sed 's/\.gmo$$//'`; \
132 rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE).mo; \
134 if test "$(PACKAGE)" = "gettext"; then \
135 rm -f $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
142 dvi info tags TAGS ID:
145 rm -f core core.* *.pox $(PACKAGE).po *.new.po
151 rm -f Makefile Makefile.in POTFILES *.mo
153 maintainer-clean: distclean
154 @echo "This command is intended for maintainers to use;"
155 @echo "it deletes files that may require special tools to rebuild."
158 distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
160 # If you change following line, update also configure.ac where it
161 # builds Makefile if NLS disabled.
165 # This is a separate target because 'update-po' must be executed before.
167 dists="$(DISTFILES)"; \
168 for file in $$dists; do \
169 if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
170 cp -p $$dir/$$file $(distdir); \
173 # If you change following line, update also configure.ac where it
174 # builds Makefile if NLS disabled.
176 $(MAKE) $(PACKAGE).pot
177 if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; fi; \
179 catalogs='$(GMOFILES)'; \
180 for cat in $$catalogs; do \
181 cat=`basename $$cat`; \
182 lang=`echo $$cat | sed 's/\.gmo$$//'`; \
183 if test -x "$(builddir)/$$lang.po" ; then \
189 if $(MSGMERGE) $$dir/$$lang.po $(PACKAGE).pot -o $$lang.new.po; then \
190 mv -f $$lang.new.po $$dir/$$lang.po; \
192 echo "msgmerge for $$cat failed!"; \
193 rm -f $$lang.new.po; \
198 update-gmo: Makefile $(GMOFILES)
201 Makefile: Makefile.in.in $(top_builddir)/config.status POTFILES.in
203 && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \
204 $(SHELL) ./config.status
206 # Tell versions [3.59,3.63) of GNU make not to export all variables.
207 # Otherwise a system limit (for SysV at least) may be exceeded.