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> |
---|
3 | # |
---|
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. |
---|
8 | |
---|
9 | PACKAGE = @PACKAGE@ |
---|
10 | VERSION = @VERSION@ |
---|
11 | |
---|
12 | # These two variables depend on the location of this directory. |
---|
13 | subdir = po |
---|
14 | top_builddir = .. |
---|
15 | |
---|
16 | SHELL = /bin/sh |
---|
17 | @SET_MAKE@ |
---|
18 | |
---|
19 | srcdir = @srcdir@ |
---|
20 | top_srcdir = @top_srcdir@ |
---|
21 | VPATH = @srcdir@ |
---|
22 | |
---|
23 | prefix = @prefix@ |
---|
24 | exec_prefix = @exec_prefix@ |
---|
25 | datadir = @datadir@ |
---|
26 | localedir = $(datadir)/locale |
---|
27 | gettextsrcdir = $(datadir)/gettext/po |
---|
28 | |
---|
29 | INSTALL = @INSTALL@ |
---|
30 | INSTALL_DATA = @INSTALL_DATA@ |
---|
31 | MKINSTALLDIRS = @MKINSTALLDIRS@ |
---|
32 | mkinstalldirs = $(SHELL) `case "$(MKINSTALLDIRS)" in /*) echo "$(MKINSTALLDIRS)" ;; *) echo "$(top_builddir)/$(MKINSTALLDIRS)" ;; esac` |
---|
33 | |
---|
34 | CC = @CC@ |
---|
35 | GMSGFMT = @GMSGFMT@ |
---|
36 | MSGFMT = @MSGFMT@ |
---|
37 | XGETTEXT = @XGETTEXT@ |
---|
38 | XML_I18N_UPDATE = @XML_I18N_UPDATE@ |
---|
39 | XML_I18N_EXTRACT = @XML_I18N_EXTRACT@ |
---|
40 | |
---|
41 | MSGMERGE = XML_I18N_EXTRACT=$(XML_I18N_EXTRACT) $(XML_I18N_UPDATE) --dist |
---|
42 | GENPOT = XML_I18N_EXTRACT=$(XML_I18N_EXTRACT) $(XML_I18N_UPDATE) --pot |
---|
43 | |
---|
44 | |
---|
45 | DEFS = @DEFS@ |
---|
46 | CFLAGS = @CFLAGS@ |
---|
47 | CPPFLAGS = @CPPFLAGS@ |
---|
48 | |
---|
49 | INCLUDES = -I.. -I$(top_srcdir)/intl |
---|
50 | |
---|
51 | COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) |
---|
52 | |
---|
53 | POFILES = @POFILES@ |
---|
54 | GMOFILES = @GMOFILES@ |
---|
55 | DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(PACKAGE).pot \ |
---|
56 | $(POFILES) $(GMOFILES) |
---|
57 | |
---|
58 | POTFILES = \ |
---|
59 | |
---|
60 | CATALOGS = @CATALOGS@ |
---|
61 | |
---|
62 | .SUFFIXES: |
---|
63 | .SUFFIXES: .c .o .po .pox .gmo .mo |
---|
64 | |
---|
65 | .c.o: |
---|
66 | $(COMPILE) $< |
---|
67 | |
---|
68 | .po.pox: |
---|
69 | $(MAKE) $(PACKAGE).pot |
---|
70 | $(MSGMERGE) $< $(srcdir)/$(PACKAGE).pot -o $*.pox |
---|
71 | |
---|
72 | .po.mo: |
---|
73 | $(MSGFMT) -o $@ $< |
---|
74 | |
---|
75 | .po.gmo: |
---|
76 | file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \ |
---|
77 | && rm -f $$file && $(GMSGFMT) --statistics -o $$file $< |
---|
78 | |
---|
79 | |
---|
80 | all: all-@USE_NLS@ |
---|
81 | |
---|
82 | all-yes: $(CATALOGS) |
---|
83 | all-no: |
---|
84 | |
---|
85 | # Note: Target 'all' must not depend on target '$(srcdir)/$(PACKAGE).pot', |
---|
86 | # otherwise packages like GCC can not be built if only parts of the source |
---|
87 | # have been downloaded. |
---|
88 | |
---|
89 | $(srcdir)/$(PACKAGE).pot: $(POTFILES) $(srcdir)/POTFILES.in |
---|
90 | $(GENPOT) |
---|
91 | |
---|
92 | |
---|
93 | install: install-exec install-data |
---|
94 | install-exec: |
---|
95 | install-data: install-data-@USE_NLS@ |
---|
96 | if test "$(PACKAGE)" = "gettext"; then \ |
---|
97 | $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \ |
---|
98 | $(INSTALL_DATA) $(srcdir)/Makefile.in.in \ |
---|
99 | $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \ |
---|
100 | else \ |
---|
101 | : ; \ |
---|
102 | fi |
---|
103 | install-data-no: all |
---|
104 | install-data-yes: all |
---|
105 | $(mkinstalldirs) $(DESTDIR)$(datadir) |
---|
106 | @catalogs='$(CATALOGS)'; \ |
---|
107 | for cat in $$catalogs; do \ |
---|
108 | cat=`basename $$cat`; \ |
---|
109 | lang=`echo $$cat | sed 's/\.gmo$$//'`; \ |
---|
110 | dir=$(localedir)/$$lang/LC_MESSAGES; \ |
---|
111 | $(mkinstalldirs) $(DESTDIR)$$dir; \ |
---|
112 | if test -r $$cat; then \ |
---|
113 | $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \ |
---|
114 | echo "installing $$cat as $(DESTDIR)$$dir/$(PACKAGE).mo"; \ |
---|
115 | else \ |
---|
116 | $(INSTALL_DATA) $(srcdir)/$$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \ |
---|
117 | echo "installing $(srcdir)/$$cat as" \ |
---|
118 | "$(DESTDIR)$$dir/$(PACKAGE).mo"; \ |
---|
119 | fi; \ |
---|
120 | done |
---|
121 | |
---|
122 | # Define this as empty until I found a useful application. |
---|
123 | installcheck: |
---|
124 | |
---|
125 | uninstall: |
---|
126 | catalogs='$(CATALOGS)'; \ |
---|
127 | for cat in $$catalogs; do \ |
---|
128 | cat=`basename $$cat`; \ |
---|
129 | lang=`echo $$cat | sed 's/\.gmo$$//'`; \ |
---|
130 | rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE).mo; \ |
---|
131 | done |
---|
132 | if test "$(PACKAGE)" = "gettext"; then \ |
---|
133 | rm -f $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \ |
---|
134 | else \ |
---|
135 | : ; \ |
---|
136 | fi |
---|
137 | |
---|
138 | check: all |
---|
139 | |
---|
140 | dvi info tags TAGS ID: |
---|
141 | |
---|
142 | mostlyclean: |
---|
143 | rm -f core core.* *.pox $(PACKAGE).po *.new.po |
---|
144 | rm -fr *.o |
---|
145 | |
---|
146 | clean: mostlyclean |
---|
147 | |
---|
148 | distclean: clean |
---|
149 | rm -f Makefile Makefile.in POTFILES *.mo |
---|
150 | |
---|
151 | maintainer-clean: distclean |
---|
152 | @echo "This command is intended for maintainers to use;" |
---|
153 | @echo "it deletes files that may require special tools to rebuild." |
---|
154 | rm -f $(GMOFILES) |
---|
155 | |
---|
156 | distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) |
---|
157 | dist distdir: |
---|
158 | $(MAKE) update-po |
---|
159 | @$(MAKE) dist2 |
---|
160 | # This is a separate target because 'update-po' must be executed before. |
---|
161 | dist2: $(DISTFILES) |
---|
162 | dists="$(DISTFILES)"; \ |
---|
163 | for file in $$dists; do \ |
---|
164 | if test -f $$file; then dir=.; else dir=$(srcdir); fi; \ |
---|
165 | cp -p $$dir/$$file $(distdir); \ |
---|
166 | done |
---|
167 | |
---|
168 | update-po: Makefile |
---|
169 | $(MAKE) $(PACKAGE).pot |
---|
170 | if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; fi; \ |
---|
171 | cd $(srcdir); \ |
---|
172 | catalogs='$(GMOFILES)'; \ |
---|
173 | for cat in $$catalogs; do \ |
---|
174 | cat=`basename $$cat`; \ |
---|
175 | lang=`echo $$cat | sed 's/\.gmo$$//'`; \ |
---|
176 | cp $$lang.po $$lang.old.po; \ |
---|
177 | echo "$$lang:"; \ |
---|
178 | if $(MSGMERGE) $$lang ; then \ |
---|
179 | rm -f $$lang.old.po; \ |
---|
180 | else \ |
---|
181 | echo "msgmerge for $$cat failed!"; \ |
---|
182 | mv $$lang.old.po $$lang.po; \ |
---|
183 | fi; \ |
---|
184 | done |
---|
185 | $(MAKE) update-gmo |
---|
186 | |
---|
187 | .po: Makefile |
---|
188 | $(MAKE) $(PACKAGE).pot; |
---|
189 | PATH=`pwd`/../src:$$PATH; \ |
---|
190 | echo; printf "$*: "; \ |
---|
191 | if $(MSGMERGE) $*; then \ |
---|
192 | rm -f $*.old.po; \ |
---|
193 | else \ |
---|
194 | echo "msgmerge for * failed!"; \ |
---|
195 | mv $*.old.po $*.po; \ |
---|
196 | fi; \ |
---|
197 | msgfmt --statistics $*.po; echo; |
---|
198 | |
---|
199 | |
---|
200 | update-gmo: Makefile $(GMOFILES) |
---|
201 | @: |
---|
202 | |
---|
203 | Makefile: Makefile.in.in $(top_builddir)/config.status POTFILES.in |
---|
204 | cd $(top_builddir) \ |
---|
205 | && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \ |
---|
206 | $(SHELL) ./config.status |
---|
207 | |
---|
208 | # Tell versions [3.59,3.63) of GNU make not to export all variables. |
---|
209 | # Otherwise a system limit (for SysV at least) may be exceeded. |
---|
210 | .NOEXPORT: |
---|