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 General 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.
12 # These two variables depend on the location of this directory.
20 top_srcdir = @top_srcdir@
24 exec_prefix = @exec_prefix@
26 localedir = $(datadir)/locale
27 gettextsrcdir = $(datadir)/gettext/po
30 INSTALL_DATA = @INSTALL_DATA@
31 MKINSTALLDIRS = @MKINSTALLDIRS@
32 mkinstalldirs = $(SHELL) `case "$(MKINSTALLDIRS)" in /*) echo "$(MKINSTALLDIRS)" ;; *) echo "$(top_builddir)/$(MKINSTALLDIRS)" ;; esac`
44 INCLUDES = -I.. -I$(top_srcdir)/intl
46 COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
50 DISTFILES = Makefile.in.in POTFILES.in $(PACKAGE).pot \
51 $(POFILES) $(GMOFILES)
58 .SUFFIXES: .c .o .po .pox .gmo .mo
64 $(MAKE) $(PACKAGE).pot
65 $(MSGMERGE) $< $(srcdir)/$(PACKAGE).pot -o $*.pox
71 file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \
72 && rm -f $$file && $(GMSGFMT) --statistics -o $$file $<
80 .PHONY: ../keymap_alldefs.h
82 cd .. && $(MAKE) keymap_alldefs.h
84 # Note: Target 'all' must not depend on target '$(srcdir)/$(PACKAGE).pot',
85 # otherwise packages like GCC can not be built if only parts of the source
86 # have been downloaded.
88 $(srcdir)/$(PACKAGE).pot: $(POTFILES) $(srcdir)/POTFILES.in
89 $(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \
90 --add-comments --keyword=_ --keyword=N_ \
91 --files-from=$(srcdir)/POTFILES.in \
92 && test ! -f $(PACKAGE).po \
93 || ( rm -f $(srcdir)/$(PACKAGE).pot \
94 && mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot )
97 install: install-exec install-data
99 install-data: install-data-@USE_NLS@
100 if test "$(PACKAGE)" = "gettext"; then \
101 $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
102 $(INSTALL_DATA) $(srcdir)/Makefile.in.in \
103 $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
108 install-data-yes: all
109 $(mkinstalldirs) $(DESTDIR)$(datadir)
110 @catalogs='$(CATALOGS)'; \
111 for cat in $$catalogs; do \
112 cat=`basename $$cat`; \
113 lang=`echo $$cat | sed 's/\.gmo$$//'`; \
114 dir=$(localedir)/$$lang/LC_MESSAGES; \
115 $(mkinstalldirs) $(DESTDIR)$$dir; \
116 if test -r $$cat; then \
117 $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
118 echo "installing $$cat as $(DESTDIR)$$dir/$(PACKAGE).mo"; \
120 $(INSTALL_DATA) $(srcdir)/$$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
121 echo "installing $(srcdir)/$$cat as" \
122 "$(DESTDIR)$$dir/$(PACKAGE).mo"; \
126 # Define this as empty until I found a useful application.
130 catalogs='$(CATALOGS)'; \
131 for cat in $$catalogs; do \
132 cat=`basename $$cat`; \
133 lang=`echo $$cat | sed 's/\.gmo$$//'`; \
134 rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE).mo; \
136 if test "$(PACKAGE)" = "gettext"; then \
137 rm -f $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
144 dvi info tags TAGS ID:
147 rm -f core core.* *.pox $(PACKAGE).po *.new.po
153 rm -f Makefile Makefile.in POTFILES *.mo *.gmo
155 maintainer-clean: distclean
156 @echo "This command is intended for maintainers to use;"
157 @echo "it deletes files that may require special tools to rebuild."
160 distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
164 # This is a separate target because 'update-po' must be executed before.
166 dists="$(DISTFILES)"; \
167 for file in $$dists; do \
168 if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
169 cp -p $$dir/$$file $(distdir); \
173 $(MAKE) $(PACKAGE).pot
174 if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; fi; \
176 catalogs='$(GMOFILES)'; \
177 for cat in $$catalogs; do \
178 cat=`basename $$cat`; \
179 lang=`echo $$cat | sed 's/\.gmo$$//'`; \
181 if $(MSGMERGE) $$lang.po $(PACKAGE).pot -o $$lang.new.po; then \
182 mv -f $$lang.new.po $$lang.po; \
184 echo "msgmerge for $$cat failed!"; \
185 rm -f $$lang.new.po; \
190 update-gmo: Makefile $(GMOFILES)
193 Makefile: Makefile.in.in $(top_builddir)/config.status POTFILES.in
195 && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \
196 $(SHELL) ./config.status
198 # Tell versions [3.59,3.63) of GNU make not to export all variables.
199 # Otherwise a system limit (for SysV at least) may be exceeded.