1 ## Makefile for the gettext-tools/src subdirectory of GNU gettext
2 ## Copyright (C) 1995-1998, 2000-2005 Free Software Foundation, Inc.
4 ## This program is free software; you can redistribute it and/or modify
5 ## it under the terms of the GNU General Public License as published by
6 ## the Free Software Foundation; either version 2, or (at your option)
9 ## This program is distributed in the hope that it will be useful,
10 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ## GNU General Public License for more details.
14 ## You should have received a copy of the GNU General Public License
15 ## along with this program; if not, write to the Free Software
16 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 ## Process this file with automake to produce Makefile.in.
20 AUTOMAKE_OPTIONS = 1.5 gnits no-dependencies
28 msgcmp msgfmt msgmerge msgunfmt xgettext \
29 msgattrib msgcat msgcomm msgconv msgen msgexec msgfilter msggrep msginit msguniq
31 noinst_PROGRAMS = hostname urlget
33 lib_LTLIBRARIES = libgettextsrc.la libgettextpo.la
35 include_HEADERS = gettext-po.h
37 noinst_HEADERS = pos.h message.h po-error.h po-gram.h po-charset.h \
39 read-po-abstract.h read-po.h read-properties.h read-stringtable.h \
41 write-po.h write-properties.h write-stringtable.h \
42 dir-list.h file-list.h po-gram-gen.h po-gram-gen2.h \
43 msgl-charset.h msgl-equal.h msgl-iconv.h msgl-ascii.h msgl-cat.h \
44 msgl-english.h msgfmt.h msgunfmt.h plural-count.h \
45 read-mo.h write-mo.h \
46 read-java.h write-java.h \
47 read-csharp.h write-csharp.h \
48 read-resources.h write-resources.h \
49 read-tcl.h write-tcl.h \
51 po-time.h plural-table.h format.h \
52 xgettext.h x-c.h x-po.h x-sh.h x-python.h x-lisp.h x-elisp.h x-librep.h \
53 x-scheme.h x-smalltalk.h x-java.h x-properties.h x-csharp.h x-awk.h x-ycp.h \
54 x-tcl.h x-perl.h x-php.h x-stringtable.h x-rst.h x-glade.h
56 EXTRA_DIST += FILES project-id ChangeLog.0
58 localedir = $(datadir)/locale
59 aliaspath = $(localedir)
60 jardir = $(datadir)/gettext
61 pkgdatadir = $(datadir)/gettext
62 projectsdir = $(pkgdatadir)/projects
63 pkglibdir = $(libdir)/gettext
68 -I$(top_srcdir)/libgrep \
69 -I$(top_srcdir)/libuniname \
70 -I../lib -I$(top_srcdir)/lib \
71 -I../intl -I$(top_srcdir)/../gettext-runtime/intl
73 -DLOCALEDIR=\"$(localedir)\" \
74 -DLOCALE_ALIAS_PATH=\"$(aliaspath)\" \
75 -DUSEJEXE=$(USEJEXE) \
76 -DGETTEXTJEXEDIR=\"$(pkglibdir)\" \
77 -DGETTEXTJAR=\"$(jardir)/gettext.jar\" \
78 -DLIBDIR=\"$(libdir)\" \
79 -DGETTEXTDATADIR=\"$(pkgdatadir)\" \
80 -DPROJECTSDIR=\"$(projectsdir)\" @DEFS@
81 LDADD = ../lib/libgettextlib.la @LTLIBINTL@
88 JAVACOMP = $(SHELL) ../lib/javacomp.sh
89 CSHARPCOMP = $(SHELL) ../lib/csharpcomp.sh
90 CSHARPCOMPFLAGS = -O -g
93 # All programs deal with message lists.
94 # All programs must read PO files. (msgunfmt also, for read-java.c,
95 # read-csharp.c and read-resources.c.)
96 # message.c -> str-list.c.
97 # (read-po-abstract.c <--> po-gram-gen.y <--> po-lex.c) -> str-list.c.
98 # (read-po-abstract.c <--> po-gram-gen.y <--> po-lex.c) -> open-po.c -> dir-list.c -> str-list.c.
99 # (read-po-abstract.c <--> po-gram-gen.y <--> po-lex.c) -> po-charset.c.
100 # (read-po-abstract.c <--> po-gram-gen.y <--> po-lex.c) -> message.c -> str-list.c.
101 COMMON_SOURCE = message.c po-error.c \
102 read-po-abstract.c po-lex.c po-gram-gen.y po-charset.c \
103 read-properties.c read-stringtable.c open-po.c dir-list.c str-list.c
105 # xgettext and msgfmt deal with format strings.
106 FORMAT_SOURCE = format.c format-invalid.h \
107 format-c.c format-sh.c format-python.c format-lisp.c format-elisp.c \
108 format-librep.c format-scheme.c format-java.c format-csharp.c format-awk.c \
109 format-pascal.c format-ycp.c format-tcl.c format-perl.c format-perl-brace.c \
110 format-php.c format-gcc-internal.c format-qt.c
112 # libgettextsrc contains all code that is needed by at least two programs.
113 libgettextsrc_la_SOURCES = \
114 $(COMMON_SOURCE) read-po.c write-properties.c write-stringtable.c write-po.c \
115 msgl-ascii.c msgl-iconv.c msgl-equal.c msgl-cat.c msgl-english.c file-list.c \
116 msgl-charset.c po-time.c plural.c plural-table.c $(FORMAT_SOURCE)
118 # libgettextpo contains the public API for PO files.
119 libgettextpo_la_SOURCES = gettext-po.c
120 # Libtool's library version information for libgettextpo.
121 # See the libtool documentation, section "Library interface versions".
126 # msggrep needs pattern matching.
127 LIBGREP = ../libgrep/libgrep.a
129 # x-python needs table of Unicode character names.
130 LIBUNINAME = ../libuniname/libuniname.a
132 # Source dependencies.
133 msgcmp_SOURCES = msgcmp.c
134 msgfmt_SOURCES = msgfmt.c \
135 write-mo.c write-java.c write-csharp.c write-resources.c write-tcl.c \
136 write-qt.c plural-eval.c
137 msgmerge_SOURCES = msgmerge.c plural-count.c
138 msgunfmt_SOURCES = msgunfmt.c \
139 read-mo.c read-java.c read-csharp.c read-resources.c read-tcl.c
140 xgettext_SOURCES = xgettext.c \
141 x-c.c x-po.c x-sh.c x-python.c x-lisp.c x-elisp.c x-librep.c x-scheme.c \
142 x-smalltalk.c x-java.c x-csharp.c x-awk.c x-ycp.c x-tcl.c x-perl.c x-php.c \
144 msgattrib_SOURCES = msgattrib.c
145 msgcat_SOURCES = msgcat.c
146 msgcomm_SOURCES = msgcomm.c
147 msgconv_SOURCES = msgconv.c
148 msgen_SOURCES = msgen.c
149 msgexec_SOURCES = msgexec.c
150 msgfilter_SOURCES = msgfilter.c
151 msggrep_SOURCES = msggrep.c
152 msginit_SOURCES = msginit.c plural-count.c ../../gettext-runtime/intl/localealias.c
153 msguniq_SOURCES = msguniq.c
154 hostname_SOURCES = hostname.c
155 urlget_SOURCES = urlget.c
157 # How to build libgettextsrc.la.
158 # Need ../lib/libgettextlib.la.
159 # Need @LTLIBINTL@ because many source files use gettext().
160 # Need @LTLIBICONV@ because po-charset.c, po-lex.c, msgl-iconv.c, write-po.c
162 libgettextsrc_la_LDFLAGS = \
164 ../lib/libgettextlib.la @LTLIBINTL@ @LTLIBICONV@ -lc -no-undefined
166 # No need to install libgettextsrc.a, except on AIX.
167 install-exec-local: install-libLTLIBRARIES install-exec-clean
169 case "@host_os@" in \
171 *) $(RM) $(DESTDIR)$(libdir)/libgettextsrc.a ;; \
174 # How to build libgettextpo.la.
175 # Need libgettextsrc.la.
176 # Need ../lib/libgettextlib.la because of xmalloc.
177 libgettextpo_la_LDFLAGS = \
178 -version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) \
180 libgettextsrc.la ../lib/libgettextlib.la @LTLIBINTL@ @LTLIBICONV@ -lc -no-undefined
181 # Build order. Only needed for "make -j[N]".
182 libgettextpo_la_DEPENDENCIES = libgettextsrc.la
185 # INTL_MACOSX_LIBS is needed because the programs depend on libintl.la
186 # but libtool doesn't put -Wl,-framework options into .la files.
187 # For msginit, it is also needed because of localename.c.
188 msgcmp_LDADD = libgettextsrc.la @INTL_MACOSX_LIBS@
189 msgfmt_LDADD = libgettextsrc.la @INTL_MACOSX_LIBS@
190 msgmerge_LDADD = libgettextsrc.la @INTL_MACOSX_LIBS@
191 msgunfmt_LDADD = libgettextsrc.la @INTL_MACOSX_LIBS@
192 xgettext_LDADD = $(LIBUNINAME) libgettextsrc.la @INTL_MACOSX_LIBS@ @LTLIBEXPAT@
193 msgattrib_LDADD = libgettextsrc.la @INTL_MACOSX_LIBS@
194 msgcat_LDADD = libgettextsrc.la @INTL_MACOSX_LIBS@
195 msgcomm_LDADD = libgettextsrc.la @INTL_MACOSX_LIBS@
196 msgconv_LDADD = libgettextsrc.la @INTL_MACOSX_LIBS@
197 msgen_LDADD = libgettextsrc.la @INTL_MACOSX_LIBS@
198 msgexec_LDADD = libgettextsrc.la @INTL_MACOSX_LIBS@
199 msgfilter_LDADD = libgettextsrc.la @INTL_MACOSX_LIBS@
200 msggrep_LDADD = $(LIBGREP) libgettextsrc.la @INTL_MACOSX_LIBS@
201 msginit_LDADD = ../intl/localename.@INTL_LIBTOOL_SUFFIX_PREFIX@o \
202 libgettextsrc.la @INTL_MACOSX_LIBS@
203 msguniq_LDADD = libgettextsrc.la @INTL_MACOSX_LIBS@
205 # Specify installation directory, for --enable-relocatable.
206 msgcmp_CFLAGS = -DINSTALLDIR=\"$(bindir)\"
207 msgfmt_CFLAGS = -DINSTALLDIR=\"$(bindir)\"
208 msgmerge_CFLAGS = -DINSTALLDIR=\"$(bindir)\"
209 msgunfmt_CFLAGS = -DINSTALLDIR=\"$(bindir)\"
210 xgettext_CFLAGS = -DINSTALLDIR=\"$(bindir)\"
211 msgattrib_CFLAGS = -DINSTALLDIR=\"$(bindir)\"
212 msgcat_CFLAGS = -DINSTALLDIR=\"$(bindir)\"
213 msgcomm_CFLAGS = -DINSTALLDIR=\"$(bindir)\"
214 msgconv_CFLAGS = -DINSTALLDIR=\"$(bindir)\"
215 msgen_CFLAGS = -DINSTALLDIR=\"$(bindir)\"
216 msgexec_CFLAGS = -DINSTALLDIR=\"$(bindir)\"
217 msgfilter_CFLAGS = -DINSTALLDIR=\"$(bindir)\"
218 msggrep_CFLAGS = -DINSTALLDIR=\"$(bindir)\"
219 msginit_CFLAGS = -DINSTALLDIR=\"$(bindir)\"
220 msguniq_CFLAGS = -DINSTALLDIR=\"$(bindir)\"
221 hostname_CFLAGS = -DINSTALLDIR=\"$(pkglibdir)\"
222 urlget_CFLAGS = -DINSTALLDIR=\"$(pkglibdir)\"
223 if RELOCATABLE_VIA_LD
224 msgcmp_LDFLAGS = `$(RELOCATABLE_LDFLAGS) $(bindir)`
225 msgfmt_LDFLAGS = `$(RELOCATABLE_LDFLAGS) $(bindir)`
226 msgmerge_LDFLAGS = `$(RELOCATABLE_LDFLAGS) $(bindir)`
227 msgunfmt_LDFLAGS = `$(RELOCATABLE_LDFLAGS) $(bindir)`
228 xgettext_LDFLAGS = `$(RELOCATABLE_LDFLAGS) $(bindir)`
229 msgattrib_LDFLAGS = `$(RELOCATABLE_LDFLAGS) $(bindir)`
230 msgcat_LDFLAGS = `$(RELOCATABLE_LDFLAGS) $(bindir)`
231 msgcomm_LDFLAGS = `$(RELOCATABLE_LDFLAGS) $(bindir)`
232 msgconv_LDFLAGS = `$(RELOCATABLE_LDFLAGS) $(bindir)`
233 msgen_LDFLAGS = `$(RELOCATABLE_LDFLAGS) $(bindir)`
234 msgexec_LDFLAGS = `$(RELOCATABLE_LDFLAGS) $(bindir)`
235 msgfilter_LDFLAGS = `$(RELOCATABLE_LDFLAGS) $(bindir)`
236 msggrep_LDFLAGS = `$(RELOCATABLE_LDFLAGS) $(bindir)`
237 msginit_LDFLAGS = `$(RELOCATABLE_LDFLAGS) $(bindir)`
238 msguniq_LDFLAGS = `$(RELOCATABLE_LDFLAGS) $(bindir)`
239 hostname_LDFLAGS = `$(RELOCATABLE_LDFLAGS) $(pkglibdir)`
240 urlget_LDFLAGS = `$(RELOCATABLE_LDFLAGS) $(pkglibdir)`
243 # Special rules for bison and flex generated files.
246 po-gram-gen.c po-gram-gen.h po-gram-gen2.h
248 po-lex.o po-lex.lo: po-gram-gen2.h
249 po-gram-gen2.h: po-gram-gen.h
250 $(SED) -e 's/yy/po_gram_/g' -e 's/extern /extern DLL_VARIABLE /' $(srcdir)/po-gram-gen.h > $@-tmp
254 # Special rules for installation of auxiliary programs.
257 $(mkinstalldirs) $(DESTDIR)$(pkglibdir)
258 $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) hostname$(EXEEXT) $(DESTDIR)$(pkglibdir)/hostname$(EXEEXT)
259 $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) urlget$(EXEEXT) $(DESTDIR)$(pkglibdir)/urlget$(EXEEXT)
260 $(INSTALL_SCRIPT) user-email $(DESTDIR)$(pkglibdir)/user-email
261 $(INSTALL_SCRIPT) $(srcdir)/project-id $(DESTDIR)$(pkglibdir)/project-id
264 $(mkinstalldirs) $(DESTDIR)$(pkglibdir)
267 $(RM) $(DESTDIR)$(pkglibdir)/hostname$(EXEEXT)
268 $(RM) $(DESTDIR)$(pkglibdir)/urlget$(EXEEXT)
269 $(RM) $(DESTDIR)$(pkglibdir)/user-email
270 $(RM) $(DESTDIR)$(pkglibdir)/project-id
272 DISTCLEANFILES += user-email
275 # Special rules for Java compilation.
277 USEJEXE = $(USEJEXE_@BUILDJAVAEXE@)
281 all-local: all-java-@BUILDJAVAEXE@
282 all-java-yes: gnu.gettext.DumpResource$(EXEEXT) gnu.gettext.GetURL$(EXEEXT)
283 all-java-no: all-java-no-@BUILDJAVA@
284 all-java-no-yes: gettext.jar
287 gnu.gettext.DumpResource$(EXEEXT): $(srcdir)/gnu/gettext/DumpResource.java
288 $(GCJ) $(GCJFLAGS) $(srcdir)/gnu/gettext/DumpResource.java --main=gnu.gettext.DumpResource -o $@
290 gnu.gettext.GetURL$(EXEEXT): $(srcdir)/gnu/gettext/GetURL.java
291 $(GCJ) $(GCJFLAGS) $(srcdir)/gnu/gettext/GetURL.java --main=gnu.gettext.GetURL -o $@
293 gnu/gettext/DumpResource.class: $(srcdir)/gnu/gettext/DumpResource.java
294 $(JAVACOMP) -d . $(srcdir)/gnu/gettext/DumpResource.java
296 gnu/gettext/GetURL.class: $(srcdir)/gnu/gettext/GetURL.java
297 $(JAVACOMP) -d . $(srcdir)/gnu/gettext/GetURL.java
299 gettext.jar: gnu/gettext/DumpResource.class gnu/gettext/GetURL.class
300 $(JAR) cf $@ gnu/gettext/DumpResource*.class gnu/gettext/GetURL*.class
302 EXTRA_DIST += gnu/gettext/DumpResource.java gnu/gettext/GetURL.java
304 CLEANFILES += gnu.gettext.DumpResource$(EXEEXT) gnu.gettext.GetURL$(EXEEXT) \
305 gettext.jar gnu/gettext/*.class
307 install-exec-local: install-exec-java-@BUILDJAVAEXE@
308 install-exec-java-yes: all-java-yes
309 $(mkinstalldirs) $(DESTDIR)$(pkglibdir)
310 $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) gnu.gettext.DumpResource$(EXEEXT) $(DESTDIR)$(pkglibdir)/gnu.gettext.DumpResource$(EXEEXT)
311 $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) gnu.gettext.GetURL$(EXEEXT) $(DESTDIR)$(pkglibdir)/gnu.gettext.GetURL$(EXEEXT)
312 install-exec-java-no:
314 install-data-local: install-data-java-@BUILDJAVAEXE@
315 install-data-java-yes:
316 install-data-java-no: install-data-java-no-@BUILDJAVA@
317 install-data-java-no-yes: all-java-no-yes
318 $(INSTALL_DATA) gettext.jar $(DESTDIR)$(jardir)/gettext.jar
319 install-data-java-no-no:
321 installdirs-local: installdirs-java-@BUILDJAVAEXE@
322 installdirs-java-yes:
323 $(mkinstalldirs) $(DESTDIR)$(pkglibdir)
324 installdirs-java-no: installdirs-java-no-@BUILDJAVA@
325 installdirs-java-no-yes:
326 $(mkinstalldirs) $(DESTDIR)$(jardir)
327 installdirs-java-no-no:
329 uninstall-local: uninstall-java-@BUILDJAVAEXE@
331 $(RM) $(DESTDIR)$(pkglibdir)/gnu.gettext.DumpResource$(EXEEXT)
332 $(RM) $(DESTDIR)$(pkglibdir)/gnu.gettext.GetURL$(EXEEXT)
333 uninstall-java-no: uninstall-java-no-@BUILDJAVA@
334 uninstall-java-no-yes:
335 $(RM) $(DESTDIR)$(jardir)/gettext.jar
336 uninstall-java-no-no:
339 # Special rules for C# auxiliary programs.
341 EXTRA_DIST += msgfmt.cs msgunfmt.cs
343 CLEANFILES += msgfmt.net.exe msgunfmt.net.exe
345 all-local: all-csharp-@BUILDCSHARP@
346 all-csharp-yes: msgfmt.net.exe msgunfmt.net.exe
349 msgfmt.net.exe: msgfmt.cs
350 $(CSHARPCOMP) $(CSHARPCOMPFLAGS) -o $@ $(srcdir)/msgfmt.cs
352 msgunfmt.net.exe: msgunfmt.cs
353 $(CSHARPCOMP) $(CSHARPCOMPFLAGS) -o $@ -L ../../gettext-runtime/intl-csharp -l GNU.Gettext $(srcdir)/msgunfmt.cs
355 install-exec-local: install-exec-csharp-@BUILDCSHARP@
356 install-exec-csharp-yes: all-csharp-yes
357 $(mkinstalldirs) $(DESTDIR)$(pkglibdir)
358 $(INSTALL_DATA) msgfmt.net.exe $(DESTDIR)$(pkglibdir)/msgfmt.net.exe
359 $(INSTALL_DATA) msgunfmt.net.exe $(DESTDIR)$(pkglibdir)/msgunfmt.net.exe
360 install-exec-csharp-no:
361 $(mkinstalldirs) $(DESTDIR)$(pkglibdir)
363 installdirs-local: install-csharp
365 $(mkinstalldirs) $(DESTDIR)$(pkglibdir)
367 uninstall-local: uninstall-csharp-@BUILDCSHARP@
368 uninstall-csharp-yes: all-csharp-yes
369 $(RM) $(DESTDIR)$(pkglibdir)/msgfmt.net.exe
370 $(RM) $(DESTDIR)$(pkglibdir)/msgunfmt.net.exe
374 # Special rules for Tcl auxiliary program.
376 EXTRA_DIST += msgunfmt.tcl
378 install-data-local: install-tcl
380 $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)
381 $(INSTALL_DATA) $(srcdir)/msgunfmt.tcl $(DESTDIR)$(pkgdatadir)/msgunfmt.tcl
383 installdirs-local: installdirs-tcl
385 $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)
387 uninstall-local: uninstall-tcl
389 $(RM) $(DESTDIR)$(pkgdatadir)/msgunfmt.tcl
392 # Support for relocatability.
393 RELOCATABLE_LIBRARY_PATH = $(libdir)
394 RELOCATABLE_SRC_DIR = $(top_srcdir)/lib
395 RELOCATABLE_BUILD_DIR = ../lib
396 RELOCATABLE_CONFIG_H_DIR = ..
402 EXTRA_DIST += Makefile.vms
407 EXTRA_DIST += Makefile.msvc