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.
16 top_srcdir = @top_srcdir@
20 exec_prefix = @exec_prefix@
21 datadir = $(prefix)/@DATADIRNAME@
22 localedir = $(datadir)/locale
23 gnulocaledir = $(prefix)/share/locale
24 gettextsrcdir = $(prefix)/share/gettext/po
28 INSTALL_DATA = @INSTALL_DATA@
31 GMSGFMT = PATH=../src:$$PATH @GMSGFMT@
33 XGETTEXT = PATH=../src:$$PATH @XGETTEXT@
34 MSGMERGE = PATH=../src:$$PATH msgmerge
40 INCLUDES = -I.. -I$(top_srcdir)/intl
42 COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
46 DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(PACKAGE).pot \
47 $(POFILES) $(GMOFILES) $(SOURCES)
52 CATOBJEXT = @CATOBJEXT@
53 INSTOBJEXT = @INSTOBJEXT@
56 .SUFFIXES: .c .o .po .pox .gmo .mo .msg
62 $(MAKE) $(PACKAGE).pot
63 $(MSGMERGE) $< $(srcdir)/$(PACKAGE).pot -o $*.pox
69 file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \
70 && rm -f $$file && $(GMSGFMT) -o $$file $<
78 $(srcdir)/$(PACKAGE).pot: $(POTFILES)
79 $(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \
80 --add-comments --keyword=_ --keyword=N_ \
81 --files-from=$(srcdir)/POTFILES.in
82 rm -f $(srcdir)/$(PACKAGE).pot
83 mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot
86 install: install-exec install-data
88 install-data: install-data-@USE_NLS@
91 @catalogs='$(CATALOGS)'; \
92 for cat in $$catalogs; do \
93 cat=`basename $$cat`; \
95 *.gmo) destdir=$(gnulocaledir);; \
96 *) destdir=$(localedir);; \
98 lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
99 dir=$$destdir/$$lang/LC_MESSAGES; \
100 $(top_srcdir)/mkinstalldirs $$dir; \
101 if test -r $$cat; then \
102 $(INSTALL_DATA) $$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
103 echo "installing $$cat as $$dir/$(PACKAGE)$(INSTOBJEXT)"; \
105 $(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
106 echo "installing $(srcdir)/$$cat as" \
107 "$$dir/$(PACKAGE)$(INSTOBJEXT)"; \
109 if test -r $$cat.m; then \
110 $(INSTALL_DATA) $$cat.m $$dir/$(PACKAGE)$(INSTOBJEXT).m; \
111 echo "installing $$cat.m as $$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
113 if test -r $(srcdir)/$$cat.m ; then \
114 $(INSTALL_DATA) $(srcdir)/$$cat.m \
115 $$dir/$(PACKAGE)$(INSTOBJEXT).m; \
116 echo "installing $(srcdir)/$$cat as" \
117 "$$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
123 if test "$(PACKAGE)" = "gettext"; then \
124 $(INSTALL_DATA) $(srcdir)/Makefile.in.in \
125 $(gettextsrcdir)/Makefile.in.in; \
130 # Define this as empty until I found a useful application.
134 catalogs='$(CATALOGS)'; \
135 for cat in $$catalogs; do \
136 cat=`basename $$cat`; \
137 lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
138 rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
139 rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \
140 rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
141 rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \
143 rm -f $(gettextsrcdir)/po-Makefile.in.in
147 cat-id-tbl.o: ../intl/libgettext.h
149 dvi info tags TAGS ID:
152 rm -f core core.* *.pox $(PACKAGE).po *.old.po
158 rm -f Makefile Makefile.in POTFILES *.mo *.msg
160 maintainer-clean: distclean
161 @echo "This command is intended for maintainers to use;"
162 @echo "it deletes files that may require special tools to rebuild."
165 distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
166 dist distdir: update-po $(DISTFILES)
167 dists="$(DISTFILES)"; \
168 for file in $$dists; do \
169 ln $(srcdir)/$$file $(distdir) 2> /dev/null \
170 || cp -p $(srcdir)/$$file $(distdir); \
174 $(MAKE) $(PACKAGE).pot
175 PATH=`pwd`/../src:$$PATH; \
177 catalogs='$(CATALOGS)'; \
178 for cat in $$catalogs; do \
179 cat=`basename $$cat`; \
180 lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
181 mv $$lang.po $$lang.old.po; \
183 if $(MSGMERGE) $$lang.old.po $(PACKAGE).pot -o $$lang.po; then \
184 rm -f $$lang.old.po; \
186 echo "msgmerge for $$cat failed!"; \
188 mv $$lang.old.po $$lang.po; \
192 POTFILES: POTFILES.in
193 ( if test 'x$(srcdir)' != 'x.'; then \
194 posrcprefix='$(top_srcdir)/'; \
199 && (sed -e '/^#/d' -e '/^[ ]*$$/d' \
200 -e "s@.*@ $$posrcprefix& \\\\@" < $(srcdir)/$@.in \
201 | sed -e '$$s/\\$$//') > $@-t \
205 Makefile: Makefile.in.in ../config.status POTFILES
207 && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \
208 $(SHELL) ./config.status
210 # Tell versions [3.59,3.63) of GNU make not to export all variables.
211 # Otherwise a system limit (for SysV at least) may be exceeded.