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> |
---|
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 | SHELL = /bin/sh |
---|
13 | @SET_MAKE@ |
---|
14 | |
---|
15 | srcdir = @srcdir@ |
---|
16 | top_srcdir = @top_srcdir@ |
---|
17 | VPATH = @srcdir@ |
---|
18 | |
---|
19 | prefix = @prefix@ |
---|
20 | exec_prefix = @exec_prefix@ |
---|
21 | datadir = $(prefix)/@DATADIRNAME@ |
---|
22 | localedir = $(datadir)/locale |
---|
23 | gnulocaledir = $(prefix)/share/locale |
---|
24 | gettextsrcdir = $(prefix)/share/gettext/po |
---|
25 | subdir = po |
---|
26 | |
---|
27 | DESTDIR = |
---|
28 | |
---|
29 | INSTALL = @INSTALL@ |
---|
30 | INSTALL_DATA = @INSTALL_DATA@ |
---|
31 | MKINSTALLDIRS = $(top_srcdir)/@MKINSTALLDIRS@ |
---|
32 | |
---|
33 | CC = @CC@ |
---|
34 | GENCAT = @GENCAT@ |
---|
35 | GMSGFMT = PATH=../src:$$PATH @GMSGFMT@ |
---|
36 | MSGFMT = @MSGFMT@ |
---|
37 | XGETTEXT = PATH=../src:$$PATH @XGETTEXT@ |
---|
38 | MSGMERGE = PATH=../src:$$PATH msgmerge |
---|
39 | |
---|
40 | DEFS = @DEFS@ |
---|
41 | CFLAGS = @CFLAGS@ |
---|
42 | CPPFLAGS = @CPPFLAGS@ |
---|
43 | |
---|
44 | INCLUDES = -I.. -I$(top_srcdir)/intl |
---|
45 | |
---|
46 | COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) |
---|
47 | |
---|
48 | SOURCES = cat-id-tbl.c |
---|
49 | POFILES = @POFILES@ |
---|
50 | GMOFILES = @GMOFILES@ |
---|
51 | DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(PACKAGE).pot \ |
---|
52 | stamp-cat-id $(POFILES) $(GMOFILES) $(SOURCES) |
---|
53 | |
---|
54 | POTFILES = \ |
---|
55 | |
---|
56 | CATALOGS = @CATALOGS@ |
---|
57 | CATOBJEXT = @CATOBJEXT@ |
---|
58 | INSTOBJEXT = @INSTOBJEXT@ |
---|
59 | |
---|
60 | .SUFFIXES: |
---|
61 | .SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat |
---|
62 | |
---|
63 | .c.o: |
---|
64 | $(COMPILE) $< |
---|
65 | |
---|
66 | .po.pox: |
---|
67 | $(MAKE) $(PACKAGE).pot |
---|
68 | $(MSGMERGE) $< $(srcdir)/$(PACKAGE).pot -o $*.pox |
---|
69 | |
---|
70 | .po.mo: |
---|
71 | $(MSGFMT) -o $@ $< |
---|
72 | |
---|
73 | .po.gmo: |
---|
74 | file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \ |
---|
75 | && rm -f $$file && $(GMSGFMT) -o $$file $< |
---|
76 | |
---|
77 | .po.cat: |
---|
78 | sed -f ../intl/po2msg.sed < $< > $*.msg \ |
---|
79 | && rm -f $@ && $(GENCAT) $@ $*.msg |
---|
80 | |
---|
81 | |
---|
82 | all: all-@USE_NLS@ |
---|
83 | |
---|
84 | all-yes: cat-id-tbl.c $(CATALOGS) |
---|
85 | all-no: |
---|
86 | |
---|
87 | $(srcdir)/$(PACKAGE).pot: $(POTFILES) |
---|
88 | $(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \ |
---|
89 | --add-comments --keyword=_ --keyword=N_ \ |
---|
90 | --files-from=$(srcdir)/POTFILES.in \ |
---|
91 | && test ! -f $(PACKAGE).po \ |
---|
92 | || ( rm -f $(srcdir)/$(PACKAGE).pot \ |
---|
93 | && mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot ) |
---|
94 | |
---|
95 | $(srcdir)/cat-id-tbl.c: stamp-cat-id; @: |
---|
96 | $(srcdir)/stamp-cat-id: $(PACKAGE).pot |
---|
97 | rm -f cat-id-tbl.tmp |
---|
98 | sed -f ../intl/po2tbl.sed $(srcdir)/$(PACKAGE).pot \ |
---|
99 | | sed -e "s/@PACKAGE NAME@/$(PACKAGE)/" > cat-id-tbl.tmp |
---|
100 | if cmp -s cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; then \ |
---|
101 | rm cat-id-tbl.tmp; \ |
---|
102 | else \ |
---|
103 | echo cat-id-tbl.c changed; \ |
---|
104 | rm -f $(srcdir)/cat-id-tbl.c; \ |
---|
105 | mv cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; \ |
---|
106 | fi |
---|
107 | cd $(srcdir) && rm -f stamp-cat-id && echo timestamp > stamp-cat-id |
---|
108 | |
---|
109 | |
---|
110 | install: install-exec install-data |
---|
111 | install-exec: |
---|
112 | install-data: install-data-@USE_NLS@ |
---|
113 | install-data-no: all |
---|
114 | install-data-yes: all |
---|
115 | if test -r "$(MKINSTALLDIRS)"; then \ |
---|
116 | $(MKINSTALLDIRS) $(DESTDIR)$(datadir); \ |
---|
117 | else \ |
---|
118 | $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(datadir); \ |
---|
119 | fi |
---|
120 | @catalogs='$(CATALOGS)'; \ |
---|
121 | for cat in $$catalogs; do \ |
---|
122 | cat=`basename $$cat`; \ |
---|
123 | case "$$cat" in \ |
---|
124 | *.gmo) destdir=$(DESTDIR)$(gnulocaledir);; \ |
---|
125 | *) destdir=$(DESTDIR)$(localedir);; \ |
---|
126 | esac; \ |
---|
127 | lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ |
---|
128 | dir=$$destdir/$$lang/LC_MESSAGES; \ |
---|
129 | if test -r "$(MKINSTALLDIRS)"; then \ |
---|
130 | $(MKINSTALLDIRS) $$dir; \ |
---|
131 | else \ |
---|
132 | $(SHELL) $(top_srcdir)/mkinstalldirs $$dir; \ |
---|
133 | fi; \ |
---|
134 | if test -r $$cat; then \ |
---|
135 | $(INSTALL_DATA) $$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \ |
---|
136 | echo "installing $$cat as $$dir/$(PACKAGE)$(INSTOBJEXT)"; \ |
---|
137 | else \ |
---|
138 | $(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \ |
---|
139 | echo "installing $(srcdir)/$$cat as" \ |
---|
140 | "$$dir/$(PACKAGE)$(INSTOBJEXT)"; \ |
---|
141 | fi; \ |
---|
142 | if test -r $$cat.m; then \ |
---|
143 | $(INSTALL_DATA) $$cat.m $$dir/$(PACKAGE)$(INSTOBJEXT).m; \ |
---|
144 | echo "installing $$cat.m as $$dir/$(PACKAGE)$(INSTOBJEXT).m"; \ |
---|
145 | else \ |
---|
146 | if test -r $(srcdir)/$$cat.m ; then \ |
---|
147 | $(INSTALL_DATA) $(srcdir)/$$cat.m \ |
---|
148 | $$dir/$(PACKAGE)$(INSTOBJEXT).m; \ |
---|
149 | echo "installing $(srcdir)/$$cat as" \ |
---|
150 | "$$dir/$(PACKAGE)$(INSTOBJEXT).m"; \ |
---|
151 | else \ |
---|
152 | true; \ |
---|
153 | fi; \ |
---|
154 | fi; \ |
---|
155 | done |
---|
156 | if test "$(PACKAGE)" = "gettext"; then \ |
---|
157 | if test -r "$(MKINSTALLDIRS)"; then \ |
---|
158 | $(MKINSTALLDIRS) $(DESTDIR)$(gettextsrcdir); \ |
---|
159 | else \ |
---|
160 | $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(gettextsrcdir); \ |
---|
161 | fi; \ |
---|
162 | $(INSTALL_DATA) $(srcdir)/Makefile.in.in \ |
---|
163 | $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \ |
---|
164 | else \ |
---|
165 | : ; \ |
---|
166 | fi |
---|
167 | |
---|
168 | # Define this as empty until I found a useful application. |
---|
169 | installcheck: |
---|
170 | |
---|
171 | uninstall: |
---|
172 | catalogs='$(CATALOGS)'; \ |
---|
173 | for cat in $$catalogs; do \ |
---|
174 | cat=`basename $$cat`; \ |
---|
175 | lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ |
---|
176 | rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \ |
---|
177 | rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \ |
---|
178 | rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \ |
---|
179 | rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \ |
---|
180 | done |
---|
181 | rm -f $(DESTDIR)$(gettextsrcdir)/po-Makefile.in.in |
---|
182 | |
---|
183 | check: all |
---|
184 | |
---|
185 | cat-id-tbl.o: ../intl/libgettext.h |
---|
186 | |
---|
187 | dvi info tags TAGS ID: |
---|
188 | |
---|
189 | mostlyclean: |
---|
190 | rm -f core core.* *.pox $(PACKAGE).po *.old.po cat-id-tbl.tmp |
---|
191 | rm -fr *.o |
---|
192 | |
---|
193 | clean: mostlyclean |
---|
194 | |
---|
195 | distclean: clean |
---|
196 | rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m |
---|
197 | |
---|
198 | maintainer-clean: distclean |
---|
199 | @echo "This command is intended for maintainers to use;" |
---|
200 | @echo "it deletes files that may require special tools to rebuild." |
---|
201 | rm -f $(GMOFILES) |
---|
202 | |
---|
203 | distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) |
---|
204 | dist distdir: update-po $(DISTFILES) |
---|
205 | dists="$(DISTFILES)"; \ |
---|
206 | for file in $$dists; do \ |
---|
207 | ln $(srcdir)/$$file $(distdir) 2> /dev/null \ |
---|
208 | || cp -p $(srcdir)/$$file $(distdir); \ |
---|
209 | done |
---|
210 | |
---|
211 | update-po: Makefile |
---|
212 | $(MAKE) $(PACKAGE).pot |
---|
213 | PATH=`pwd`/../src:$$PATH; \ |
---|
214 | cd $(srcdir); \ |
---|
215 | catalogs='$(CATALOGS)'; \ |
---|
216 | for cat in $$catalogs; do \ |
---|
217 | cat=`basename $$cat`; \ |
---|
218 | lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ |
---|
219 | mv $$lang.po $$lang.old.po; \ |
---|
220 | echo "$$lang:"; \ |
---|
221 | if $(MSGMERGE) $$lang.old.po $(PACKAGE).pot -o $$lang.po; then \ |
---|
222 | rm -f $$lang.old.po; \ |
---|
223 | else \ |
---|
224 | echo "msgmerge for $$cat failed!"; \ |
---|
225 | rm -f $$lang.po; \ |
---|
226 | mv $$lang.old.po $$lang.po; \ |
---|
227 | fi; \ |
---|
228 | done |
---|
229 | |
---|
230 | POTFILES: POTFILES.in |
---|
231 | ( if test 'x$(srcdir)' != 'x.'; then \ |
---|
232 | posrcprefix='$(top_srcdir)/'; \ |
---|
233 | else \ |
---|
234 | posrcprefix="../"; \ |
---|
235 | fi; \ |
---|
236 | rm -f $@-t $@ \ |
---|
237 | && (sed -e '/^#/d' -e '/^[ ]*$$/d' \ |
---|
238 | -e "s@.*@ $$posrcprefix& \\\\@" < $(srcdir)/$@.in \ |
---|
239 | | sed -e '$$s/\\$$//') > $@-t \ |
---|
240 | && chmod a-w $@-t \ |
---|
241 | && mv $@-t $@ ) |
---|
242 | |
---|
243 | Makefile: Makefile.in.in ../config.status POTFILES |
---|
244 | cd .. \ |
---|
245 | && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \ |
---|
246 | $(SHELL) ./config.status |
---|
247 | |
---|
248 | # Tell versions [3.59,3.63) of GNU make not to export all variables. |
---|
249 | # Otherwise a system limit (for SysV at least) may be exceeded. |
---|
250 | .NOEXPORT: |
---|