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 | INSTALL = @INSTALL@
|
---|
28 | INSTALL_DATA = @INSTALL_DATA@
|
---|
29 | MKINSTALLDIRS = @MKINSTALLDIRS@
|
---|
30 |
|
---|
31 | CC = @CC@
|
---|
32 | GENCAT = @GENCAT@
|
---|
33 | GMSGFMT = PATH="../src@PATH_IFS@$$PATH" @GMSGFMT@
|
---|
34 | MSGFMT = @MSGFMT@
|
---|
35 | XGETTEXT = PATH="../src@PATH_IFS@$$PATH" @XGETTEXT@
|
---|
36 | MSGMERGE = PATH="../src@PATH_IFS@$$PATH" msgmerge
|
---|
37 |
|
---|
38 | DEFS = @DEFS@
|
---|
39 | CFLAGS = @CFLAGS@
|
---|
40 | CPPFLAGS = @CPPFLAGS@
|
---|
41 |
|
---|
42 | INCLUDES = -I.. -I$(top_srcdir)/intl
|
---|
43 |
|
---|
44 | COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
|
---|
45 |
|
---|
46 | SOURCES = cat-id-tbl.c
|
---|
47 | POFILES = @POFILES@
|
---|
48 | GMOFILES = @GMOFILES@
|
---|
49 | DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(PACKAGE).pot \
|
---|
50 | stamp-cat-id $(POFILES) $(GMOFILES) $(SOURCES)
|
---|
51 |
|
---|
52 | POTFILES = \
|
---|
53 |
|
---|
54 | CATALOGS = @CATALOGS@
|
---|
55 | CATOBJEXT = @CATOBJEXT@
|
---|
56 | INSTOBJEXT = @INSTOBJEXT@
|
---|
57 |
|
---|
58 | .SUFFIXES:
|
---|
59 | .SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat
|
---|
60 |
|
---|
61 | .c.o:
|
---|
62 | $(COMPILE) $<
|
---|
63 |
|
---|
64 | .po.pox:
|
---|
65 | $(MAKE) $(PACKAGE).pot
|
---|
66 | $(MSGMERGE) $< $(srcdir)/$(PACKAGE).pot -o $*.pox
|
---|
67 |
|
---|
68 | .po.mo:
|
---|
69 | $(MSGFMT) -o $@ $<
|
---|
70 |
|
---|
71 | .po.gmo:
|
---|
72 | file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \
|
---|
73 | && test -w $$file \
|
---|
74 | && (rm -f $$file && $(GMSGFMT) -o $$file $< ) \
|
---|
75 | || echo "$$file is not writable"
|
---|
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: $(CATALOGS) @MAINT@ $(PACKAGE).pot
|
---|
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 | rm -f $(srcdir)/$(PACKAGE).pot
|
---|
92 | mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot
|
---|
93 |
|
---|
94 | $(srcdir)/cat-id-tbl.c: stamp-cat-id; @:
|
---|
95 | $(srcdir)/stamp-cat-id: $(PACKAGE).pot
|
---|
96 | rm -f cat-id-tbl.tmp
|
---|
97 | sed -f ../intl/po2tbl.sed $(srcdir)/$(PACKAGE).pot \
|
---|
98 | | sed -e "s/@PACKAGE NAME@/$(PACKAGE)/" > cat-id-tbl.tmp
|
---|
99 | if cmp -s cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; then \
|
---|
100 | rm cat-id-tbl.tmp; \
|
---|
101 | else \
|
---|
102 | echo cat-id-tbl.c changed; \
|
---|
103 | rm -f $(srcdir)/cat-id-tbl.c; \
|
---|
104 | mv cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; \
|
---|
105 | fi
|
---|
106 | cd $(srcdir) && rm -f stamp-cat-id && echo timestamp > stamp-cat-id
|
---|
107 |
|
---|
108 |
|
---|
109 | install: install-exec install-data
|
---|
110 | install-exec:
|
---|
111 | install-info:
|
---|
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) $(datadir); \
|
---|
117 | else \
|
---|
118 | $(top_srcdir)/mkinstalldirs $(datadir); \
|
---|
119 | fi
|
---|
120 | @catalogs='$(CATALOGS)'; \
|
---|
121 | for cat in $$catalogs; do \
|
---|
122 | cat=`basename $$cat`; \
|
---|
123 | case "$$cat" in \
|
---|
124 | *.gmo) destdir=$(gnulocaledir);; \
|
---|
125 | *) 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 | $(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) $(gettextsrcdir); \
|
---|
159 | else \
|
---|
160 | $(top_srcdir)/mkinstalldirs $(gettextsrcdir); \
|
---|
161 | fi; \
|
---|
162 | $(INSTALL_DATA) $(srcdir)/Makefile.in.in \
|
---|
163 | $(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 $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
|
---|
177 | rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \
|
---|
178 | rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
|
---|
179 | rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \
|
---|
180 | done
|
---|
181 | rm -f $(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_IFS@$$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 | POTFILES.in: @MAINT@ ../Makefile
|
---|
244 | cd .. && $(MAKE) po/POTFILES.in
|
---|
245 |
|
---|
246 | Makefile: Make-in ../config.status POTFILES
|
---|
247 | cd .. \
|
---|
248 | && CONFIG_FILES=$(subdir)/Makefile.in:$(subdir)/Make-in \
|
---|
249 | CONFIG_HEADERS= $(SHELL) ./config.status
|
---|
250 |
|
---|
251 | # Tell versions [3.59,3.63) of GNU make not to export all variables.
|
---|
252 | # Otherwise a system limit (for SysV at least) may be exceeded.
|
---|
253 | .NOEXPORT:
|
---|