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>
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.
18 top_srcdir = @top_srcdir@
22 exec_prefix = @exec_prefix@
23 datadir = $(prefix)/@DATADIRNAME@
24 localedir = $(datadir)/locale
25 gnulocaledir = $(prefix)/share/locale
26 gettextsrcdir = $(prefix)/share/gettext/po
30 INSTALL_DATA = @INSTALL_DATA@
33 GMSGFMT = PATH=../src:$$PATH @GMSGFMT@
35 XGETTEXT = PATH=../src:$$PATH @XGETTEXT@
36 MSGMERGE = PATH=../src:$$PATH msgmerge
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) $(SOURCES)
54 CATOBJEXT = @CATOBJEXT@
55 INSTOBJEXT = @INSTOBJEXT@
58 .SUFFIXES: .c .o .po .pox .gmo .mo .msg
64 $(MAKE) $(PACKAGE).pot
65 $(MSGMERGE) $< $(srcdir)/$(PACKAGE).pot -o $*.pox
71 file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \
72 && rm -f $$file && $(GMSGFMT) -o $$file $<
80 $(srcdir)/$(PACKAGE).pot: $(POTFILES)
81 $(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \
82 --add-comments --keyword=_ --keyword=N_ \
83 --files-from=$(srcdir)/POTFILES.in
84 rm -f $(srcdir)/$(PACKAGE).pot
85 mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot
88 install: install-exec install-data
90 install-data: install-data-@USE_NLS@
93 @catalogs='$(CATALOGS)'; \
94 for cat in $$catalogs; do \
95 cat=`basename $$cat`; \
97 *.gmo) destdir=$(gnulocaledir);; \
98 *) destdir=$(localedir);; \
100 lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
101 dir=$$destdir/$$lang/LC_MESSAGES; \
102 $(top_srcdir)/mkinstalldirs $$dir; \
103 if test -r $$cat; then \
104 $(INSTALL_DATA) $$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
105 echo "installing $$cat as $$dir/$(PACKAGE)$(INSTOBJEXT)"; \
107 $(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
108 echo "installing $(srcdir)/$$cat as" \
109 "$$dir/$(PACKAGE)$(INSTOBJEXT)"; \
111 if test -r $$cat.m; then \
112 $(INSTALL_DATA) $$cat.m $$dir/$(PACKAGE)$(INSTOBJEXT).m; \
113 echo "installing $$cat.m as $$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
115 if test -r $(srcdir)/$$cat.m ; then \
116 $(INSTALL_DATA) $(srcdir)/$$cat.m \
117 $$dir/$(PACKAGE)$(INSTOBJEXT).m; \
118 echo "installing $(srcdir)/$$cat as" \
119 "$$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
125 if test "$(PACKAGE)" = "gettext"; then \
126 $(INSTALL_DATA) $(srcdir)/Makefile.in.in \
127 $(gettextsrcdir)/Makefile.in.in; \
132 # Define this as empty until I found a useful application.
136 catalogs='$(CATALOGS)'; \
137 for cat in $$catalogs; do \
138 cat=`basename $$cat`; \
139 lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
140 rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
141 rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \
142 rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
143 rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \
145 rm -f $(gettextsrcdir)/po-Makefile.in.in
149 cat-id-tbl.o: ../intl/libgettext.h
151 dvi info tags TAGS ID:
154 rm -f core core.* *.pox $(PACKAGE).po *.old.po
160 rm -f Makefile Makefile.in POTFILES *.mo *.msg
162 maintainer-clean: distclean
163 @echo "!! This command is intended for maintainers to use;"
164 @echo "!! it deletes files that may require special tools to rebuild."
167 realclean: maintainer-clean
169 distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
170 dist distdir: update-po $(DISTFILES)
171 dists="$(DISTFILES)"; \
172 for file in $$dists; do \
173 ln $(srcdir)/$$file $(distdir) 2> /dev/null \
174 || cp -p $(srcdir)/$$file $(distdir); \
178 $(MAKE) $(PACKAGE).pot
179 PATH=`pwd`/../src:$$PATH; \
181 catalogs='$(CATALOGS)'; \
182 for cat in $$catalogs; do \
183 cat=`basename $$cat`; \
184 lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
185 mv $$lang.po $$lang.old.po; \
187 if $(MSGMERGE) $$lang.old.po $(PACKAGE).pot -o $$lang.po; then \
188 rm -f $$lang.old.po; \
190 echo "msgmerge for $$cat failed!"; \
192 mv $$lang.old.po $$lang.po; \
196 POTFILES: POTFILES.in
197 ( if test 'x$(srcdir)' != 'x.'; then \
198 posrcprefix='$(top_srcdir)/'; \
203 && (sed -e '/^#/d' -e '/^[ ]*$$/d' \
204 -e "s@.*@ $$posrcprefix& \\\\@" < $(srcdir)/$@.in \
205 | sed -e '$$s/\\$$//') > $@-t \
209 Makefile: Makefile.in.in ../config.status POTFILES
211 && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \
212 $(SHELL) ./config.status
214 # Tell versions [3.59,3.63) of GNU make not to export all variables.
215 # Otherwise a system limit (for SysV at least) may be exceeded.