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.
16 top_srcdir = @top_srcdir@
21 exec_prefix = @exec_prefix@
23 localedir = $(datadir)/locale
24 gettextsrcdir = $(datadir)/gettext/po
28 INSTALL_DATA = @INSTALL_DATA@
29 MKINSTALLDIRS = @MKINSTALLDIRS@
30 mkinstalldirs = $(SHELL) `case "$(MKINSTALLDIRS)" in /*) echo "$(MKINSTALLDIRS)" ;; *) echo "$(top_builddir)/$(MKINSTALLDIRS)" ;; esac`
42 INCLUDES = -I.. -I$(top_srcdir)/intl
44 COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
48 DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(PACKAGE).pot \
49 $(POFILES) $(GMOFILES)
56 .SUFFIXES: .c .o .po .pox .gmo .mo
62 $(MAKE) $(PACKAGE).pot
63 $(MSGMERGE) $< $(srcdir)/$(PACKAGE).pot -o $*.pox
69 file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \
70 && rm -f $$file && $(GMSGFMT) --statistics -o $$file $<
78 # Note: Target 'all' must not depend on target '$(srcdir)/$(PACKAGE).pot',
79 # otherwise packages like GCC can not be built if only parts of the source
80 # have been downloaded.
82 $(srcdir)/$(PACKAGE).pot: $(POTFILES) $(srcdir)/POTFILES.in
83 $(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \
84 --add-comments --keyword=_ --keyword=N_ \
85 --files-from=$(srcdir)/POTFILES.in \
86 && test ! -f $(PACKAGE).po \
87 || ( rm -f $(srcdir)/$(PACKAGE).pot \
88 && mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot )
91 install: install-exec install-data
93 install-data: install-data-@USE_NLS@
94 if test "$(PACKAGE)" = "gettext"; then \
95 $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
96 $(INSTALL_DATA) $(srcdir)/Makefile.in.in \
97 $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
102 install-data-yes: all
103 $(mkinstalldirs) $(DESTDIR)$(datadir)
104 @catalogs='$(CATALOGS)'; \
105 for cat in $$catalogs; do \
106 cat=`basename $$cat`; \
107 lang=`echo $$cat | sed 's/\.gmo$$//'`; \
108 dir=$(localedir)/$$lang/LC_MESSAGES; \
109 $(mkinstalldirs) $(DESTDIR)$$dir; \
110 if test -r $$cat; then \
111 $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
112 echo "installing $$cat as $(DESTDIR)$$dir/$(PACKAGE).mo"; \
114 $(INSTALL_DATA) $(srcdir)/$$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
115 echo "installing $(srcdir)/$$cat as" \
116 "$(DESTDIR)$$dir/$(PACKAGE).mo"; \
120 # Define this as empty until I found a useful application.
124 catalogs='$(CATALOGS)'; \
125 for cat in $$catalogs; do \
126 cat=`basename $$cat`; \
127 lang=`echo $$cat | sed 's/\.gmo$$//'`; \
128 rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE).mo; \
130 if test "$(PACKAGE)" = "gettext"; then \
131 rm -f $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
138 dvi info tags TAGS ID:
141 rm -f core core.* *.pox $(PACKAGE).po *.new.po
147 rm -f Makefile Makefile.in POTFILES *.mo
149 maintainer-clean: distclean
150 @echo "This command is intended for maintainers to use;"
151 @echo "it deletes files that may require special tools to rebuild."
154 distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
158 # This is a separate target because 'update-po' must be executed before.
160 dists="$(DISTFILES)"; \
161 for file in $$dists; do \
162 cp -p $(srcdir)/$$file $(distdir); \
166 $(MAKE) $(PACKAGE).pot
167 if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; fi; \
169 catalogs='$(GMOFILES)'; \
170 for cat in $$catalogs; do \
171 cat=`basename $$cat`; \
172 lang=`echo $$cat | sed 's/\.gmo$$//'`; \
174 if $(MSGMERGE) $$lang.po $(PACKAGE).pot -o $$lang.new.po; then \
175 mv -f $$lang.new.po $$lang.po; \
177 echo "msgmerge for $$cat failed!"; \
178 rm -f $$lang.new.po; \
183 update-gmo: Makefile $(GMOFILES)
186 POTFILES: POTFILES.in
187 ( if test 'x$(srcdir)' != 'x.'; then \
188 posrcprefix='$(top_srcdir)/'; \
193 && (sed -e '/^#/d' -e '/^[ ]*$$/d' \
194 -e "s@.*@ $$posrcprefix& \\\\@" < $(srcdir)/$@.in \
195 | sed -e '$$s/\\$$//') > $@-t \
199 Makefile: Makefile.in.in ../config.status POTFILES
201 && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \
202 $(SHELL) ./config.status
204 # Tell versions [3.59,3.63) of GNU make not to export all variables.
205 # Otherwise a system limit (for SysV at least) may be exceeded.