]>
Commit | Line | Data |
---|---|---|
705db0b5 | 1 | # Makefile for program source directory in GNU NLS utilities package. |
1e24cc5b | 2 | # Copyright (C) 1995-1997, 2000, 2001 by Ulrich Drepper <drepper@gnu.ai.mit.edu> |
705db0b5 AD |
3 | # |
4 | # This file file be copied and used freely without restrictions. It can | |
459dd1a6 | 5 | # be used in projects which are not available under the GNU General Public License |
705db0b5 AD |
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 | ||
1e24cc5b AD |
12 | # These two variables depend on the location of this directory. |
13 | subdir = po | |
14 | top_builddir = .. | |
15 | ||
705db0b5 AD |
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@ | |
1e24cc5b | 25 | datadir = @datadir@ |
705db0b5 | 26 | localedir = $(datadir)/locale |
1e24cc5b | 27 | gettextsrcdir = $(datadir)/gettext/po |
705db0b5 AD |
28 | |
29 | INSTALL = @INSTALL@ | |
30 | INSTALL_DATA = @INSTALL_DATA@ | |
31 | MKINSTALLDIRS = @MKINSTALLDIRS@ | |
1e24cc5b | 32 | mkinstalldirs = $(SHELL) `case "$(MKINSTALLDIRS)" in /*) echo "$(MKINSTALLDIRS)" ;; *) echo "$(top_builddir)/$(MKINSTALLDIRS)" ;; esac` |
705db0b5 AD |
33 | |
34 | CC = @CC@ | |
1e24cc5b | 35 | GMSGFMT = @GMSGFMT@ |
705db0b5 | 36 | MSGFMT = @MSGFMT@ |
1e24cc5b AD |
37 | XGETTEXT = @XGETTEXT@ |
38 | MSGMERGE = msgmerge | |
705db0b5 AD |
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 | ||
705db0b5 AD |
48 | POFILES = @POFILES@ |
49 | GMOFILES = @GMOFILES@ | |
1e24cc5b AD |
50 | DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(PACKAGE).pot \ |
51 | $(POFILES) $(GMOFILES) | |
705db0b5 AD |
52 | |
53 | POTFILES = \ | |
54 | ||
55 | CATALOGS = @CATALOGS@ | |
705db0b5 AD |
56 | |
57 | .SUFFIXES: | |
1e24cc5b | 58 | .SUFFIXES: .c .o .po .pox .gmo .mo |
705db0b5 AD |
59 | |
60 | .c.o: | |
61 | $(COMPILE) $< | |
62 | ||
63 | .po.pox: | |
64 | $(MAKE) $(PACKAGE).pot | |
65 | $(MSGMERGE) $< $(srcdir)/$(PACKAGE).pot -o $*.pox | |
66 | ||
67 | .po.mo: | |
68 | $(MSGFMT) -o $@ $< | |
69 | ||
70 | .po.gmo: | |
71 | file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \ | |
1e24cc5b | 72 | && rm -f $$file && $(GMSGFMT) --statistics -o $$file $< |
705db0b5 AD |
73 | |
74 | ||
75 | all: all-@USE_NLS@ | |
76 | ||
1e24cc5b | 77 | all-yes: $(CATALOGS) |
705db0b5 AD |
78 | all-no: |
79 | ||
1e24cc5b AD |
80 | # Note: Target 'all' must not depend on target '$(srcdir)/$(PACKAGE).pot', |
81 | # otherwise packages like GCC can not be built if only parts of the source | |
82 | # have been downloaded. | |
83 | ||
84 | $(srcdir)/$(PACKAGE).pot: $(POTFILES) $(srcdir)/POTFILES.in | |
705db0b5 AD |
85 | $(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \ |
86 | --add-comments --keyword=_ --keyword=N_ \ | |
87 | --files-from=$(srcdir)/POTFILES.in \ | |
88 | && test ! -f $(PACKAGE).po \ | |
89 | || ( rm -f $(srcdir)/$(PACKAGE).pot \ | |
90 | && mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot ) | |
91 | ||
705db0b5 AD |
92 | |
93 | install: install-exec install-data | |
94 | install-exec: | |
95 | install-data: install-data-@USE_NLS@ | |
1e24cc5b AD |
96 | if test "$(PACKAGE)" = "gettext"; then \ |
97 | $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \ | |
98 | $(INSTALL_DATA) $(srcdir)/Makefile.in.in \ | |
99 | $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \ | |
705db0b5 | 100 | else \ |
1e24cc5b | 101 | : ; \ |
705db0b5 | 102 | fi |
1e24cc5b AD |
103 | install-data-no: all |
104 | install-data-yes: all | |
105 | $(mkinstalldirs) $(DESTDIR)$(datadir) | |
705db0b5 AD |
106 | @catalogs='$(CATALOGS)'; \ |
107 | for cat in $$catalogs; do \ | |
108 | cat=`basename $$cat`; \ | |
1e24cc5b AD |
109 | lang=`echo $$cat | sed 's/\.gmo$$//'`; \ |
110 | dir=$(localedir)/$$lang/LC_MESSAGES; \ | |
111 | $(mkinstalldirs) $(DESTDIR)$$dir; \ | |
705db0b5 | 112 | if test -r $$cat; then \ |
1e24cc5b AD |
113 | $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \ |
114 | echo "installing $$cat as $(DESTDIR)$$dir/$(PACKAGE).mo"; \ | |
705db0b5 | 115 | else \ |
1e24cc5b | 116 | $(INSTALL_DATA) $(srcdir)/$$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \ |
705db0b5 | 117 | echo "installing $(srcdir)/$$cat as" \ |
1e24cc5b | 118 | "$(DESTDIR)$$dir/$(PACKAGE).mo"; \ |
705db0b5 AD |
119 | fi; \ |
120 | done | |
705db0b5 AD |
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`; \ | |
1e24cc5b AD |
129 | lang=`echo $$cat | sed 's/\.gmo$$//'`; \ |
130 | rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE).mo; \ | |
705db0b5 | 131 | done |
1e24cc5b AD |
132 | if test "$(PACKAGE)" = "gettext"; then \ |
133 | rm -f $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \ | |
134 | else \ | |
135 | : ; \ | |
136 | fi | |
705db0b5 AD |
137 | |
138 | check: all | |
139 | ||
705db0b5 AD |
140 | dvi info tags TAGS ID: |
141 | ||
142 | mostlyclean: | |
1e24cc5b | 143 | rm -f core core.* *.pox $(PACKAGE).po *.new.po |
705db0b5 AD |
144 | rm -fr *.o |
145 | ||
146 | clean: mostlyclean | |
147 | ||
148 | distclean: clean | |
1e24cc5b | 149 | rm -f Makefile Makefile.in POTFILES *.mo |
705db0b5 AD |
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 | ||
1e24cc5b AD |
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) | |
705db0b5 AD |
162 | dists="$(DISTFILES)"; \ |
163 | for file in $$dists; do \ | |
1e24cc5b AD |
164 | if test -f $$file; then dir=.; else dir=$(srcdir); fi; \ |
165 | cp -p $$dir/$$file $(distdir); \ | |
705db0b5 AD |
166 | done |
167 | ||
168 | update-po: Makefile | |
169 | $(MAKE) $(PACKAGE).pot | |
1e24cc5b | 170 | if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; fi; \ |
705db0b5 | 171 | cd $(srcdir); \ |
1e24cc5b | 172 | catalogs='$(GMOFILES)'; \ |
705db0b5 AD |
173 | for cat in $$catalogs; do \ |
174 | cat=`basename $$cat`; \ | |
1e24cc5b | 175 | lang=`echo $$cat | sed 's/\.gmo$$//'`; \ |
705db0b5 | 176 | echo "$$lang:"; \ |
1e24cc5b AD |
177 | if $(MSGMERGE) $$lang.po $(PACKAGE).pot -o $$lang.new.po; then \ |
178 | mv -f $$lang.new.po $$lang.po; \ | |
705db0b5 AD |
179 | else \ |
180 | echo "msgmerge for $$cat failed!"; \ | |
1e24cc5b | 181 | rm -f $$lang.new.po; \ |
705db0b5 AD |
182 | fi; \ |
183 | done | |
1e24cc5b | 184 | $(MAKE) update-gmo |
705db0b5 | 185 | |
1e24cc5b AD |
186 | update-gmo: Makefile $(GMOFILES) |
187 | @: | |
188 | ||
189 | Makefile: Makefile.in.in $(top_builddir)/config.status POTFILES.in | |
190 | cd $(top_builddir) \ | |
705db0b5 AD |
191 | && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \ |
192 | $(SHELL) ./config.status | |
193 | ||
194 | # Tell versions [3.59,3.63) of GNU make not to export all variables. | |
195 | # Otherwise a system limit (for SysV at least) may be exceeded. | |
196 | .NOEXPORT: |