1## Makefile for the gettext-tools/tests subdirectory of GNU gettext
2## Copyright (C) 1995-1997, 2001-2007 Free Software Foundation, Inc.
3##
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 3 of the License, or
7## (at your option) any later version.
8##
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.
13##
14## You should have received a copy of the GNU General Public License
15## along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
17## Process this file with automake to produce Makefile.in.
18
19AUTOMAKE_OPTIONS = 1.5 gnits no-dependencies
20EXTRA_DIST =
21MOSTLYCLEANFILES = core *.stackdump
22
23TESTS = gettext-1 gettext-2 gettext-3 gettext-4 gettext-5 gettext-6 gettext-7 \
24	msgattrib-1 msgattrib-2 msgattrib-3 msgattrib-4 msgattrib-5 \
25	msgattrib-6 msgattrib-7 msgattrib-8 msgattrib-9 msgattrib-10 \
26	msgattrib-11 msgattrib-12 msgattrib-13 msgattrib-14 msgattrib-15 \
27	msgattrib-16 msgattrib-17 \
28	msgattrib-properties-1 \
29	msgcat-1 msgcat-2 msgcat-3 msgcat-4 msgcat-5 msgcat-6 msgcat-7 \
30	msgcat-8 msgcat-9 msgcat-10 msgcat-11 msgcat-12 msgcat-13 msgcat-14 \
31	msgcat-15 msgcat-16 \
32	msgcat-properties-1 msgcat-properties-2 \
33	msgcat-stringtable-1 \
34	msgcmp-1 msgcmp-2 msgcmp-3 msgcmp-4 \
35	msgcomm-1 msgcomm-2 msgcomm-3 msgcomm-4 msgcomm-5 msgcomm-6 msgcomm-7 \
36	msgcomm-8 msgcomm-9 msgcomm-10 msgcomm-11 msgcomm-12 msgcomm-13 \
37	msgcomm-14 msgcomm-15 msgcomm-16 msgcomm-17 msgcomm-18 msgcomm-19 \
38	msgcomm-20 msgcomm-21 msgcomm-22 msgcomm-23 msgcomm-24 msgcomm-25 \
39	msgcomm-26 \
40	msgconv-1 msgconv-2 msgconv-3 msgconv-4 msgconv-5 msgconv-6 \
41	msgen-1 msgen-2 msgen-3 \
42	msgexec-1 msgexec-2 msgexec-3 msgexec-4 \
43	msgfilter-1 msgfilter-2 msgfilter-3 msgfilter-4 \
44	msgfilter-sr-latin-1 \
45	msgfmt-1 msgfmt-2 msgfmt-3 msgfmt-4 msgfmt-5 msgfmt-6 msgfmt-7 \
46	msgfmt-8 msgfmt-9 msgfmt-10 msgfmt-11 msgfmt-12 msgfmt-13 msgfmt-14 \
47	msgfmt-15 msgfmt-16 \
48	msgfmt-properties-1 \
49	msgfmt-qt-1 msgfmt-qt-2 \
50	msggrep-1 msggrep-2 msggrep-3 msggrep-4 msggrep-5 msggrep-6 msggrep-7 \
51	msggrep-8 \
52	msginit-1 msginit-2 \
53	msgmerge-1 msgmerge-2 msgmerge-3 msgmerge-4 msgmerge-5 msgmerge-6 \
54	msgmerge-7 msgmerge-8 msgmerge-9 msgmerge-10 msgmerge-11 msgmerge-12 \
55	msgmerge-13 msgmerge-14 msgmerge-15 msgmerge-16 msgmerge-17 \
56	msgmerge-18 msgmerge-19 msgmerge-20 msgmerge-21 msgmerge-22 \
57	msgmerge-compendium-1 msgmerge-compendium-2 msgmerge-compendium-3 \
58	msgmerge-compendium-4 msgmerge-compendium-5 msgmerge-compendium-6 \
59	msgmerge-properties-1 msgmerge-properties-2 \
60	msgmerge-update-1 msgmerge-update-2 msgmerge-update-3 \
61	msgunfmt-1 msgunfmt-2 \
62	msgunfmt-csharp-1 \
63	msgunfmt-java-1 \
64	msgunfmt-properties-1 \
65	msgunfmt-tcl-1 \
66	msguniq-1 msguniq-2 msguniq-3 msguniq-4 msguniq-5 msguniq-6 \
67	recode-sr-latin-1 recode-sr-latin-2 \
68	xgettext-1 xgettext-2 xgettext-3 xgettext-4 xgettext-5 xgettext-6 \
69	xgettext-7 xgettext-8 xgettext-9 \
70	xgettext-awk-1 xgettext-awk-2 \
71	xgettext-c-1 xgettext-c-2 xgettext-c-3 xgettext-c-4 xgettext-c-5 \
72	xgettext-c-6 xgettext-c-7 xgettext-c-8 xgettext-c-9 xgettext-c-10 \
73	xgettext-c-11 xgettext-c-12 xgettext-c-13 xgettext-c-14 xgettext-c-15 \
74	xgettext-c-16 xgettext-c-17 \
75	xgettext-csharp-1 xgettext-csharp-2 xgettext-csharp-3 \
76	xgettext-csharp-4 xgettext-csharp-5 xgettext-csharp-6 \
77	xgettext-csharp-7 \
78	xgettext-elisp-1 xgettext-elisp-2 \
79	xgettext-glade-1 xgettext-glade-2 xgettext-glade-3 \
80	xgettext-java-1 xgettext-java-2 xgettext-java-3 xgettext-java-4 \
81	xgettext-java-5 xgettext-java-6 xgettext-java-7 \
82	xgettext-librep-1 xgettext-librep-2 \
83	xgettext-lisp-1 xgettext-lisp-2 \
84	xgettext-objc-1 xgettext-objc-2 \
85	xgettext-perl-1 xgettext-perl-2 xgettext-perl-3 xgettext-perl-4 \
86	xgettext-perl-5 xgettext-perl-6 xgettext-perl-7 \
87	xgettext-php-1 xgettext-php-2 xgettext-php-3 xgettext-php-4 \
88	xgettext-po-1 \
89	xgettext-properties-1 \
90	xgettext-python-1 xgettext-python-2 xgettext-python-3 \
91	xgettext-python-4 \
92	xgettext-scheme-1 xgettext-scheme-2 xgettext-scheme-3 \
93	xgettext-sh-1 xgettext-sh-2 xgettext-sh-3 xgettext-sh-4 xgettext-sh-5 \
94	xgettext-sh-6 \
95	xgettext-smalltalk-1 xgettext-smalltalk-2 \
96	xgettext-stringtable-1 \
97	xgettext-tcl-1 xgettext-tcl-2 xgettext-tcl-3 \
98	xgettext-ycp-1 xgettext-ycp-2 xgettext-ycp-3 xgettext-ycp-4 \
99	format-awk-1 format-awk-2 \
100	format-boost-1 format-boost-2 \
101	format-c-1 format-c-2 format-c-3 format-c-4 format-c-5 \
102	format-csharp-1 format-csharp-2 \
103	format-elisp-1 format-elisp-2 \
104	format-gcc-internal-1 format-gcc-internal-2 \
105	format-java-1 format-java-2 \
106	format-kde-1 format-kde-2 \
107	format-librep-1 format-librep-2 \
108	format-lisp-1 format-lisp-2 \
109	format-php-1 format-php-2 \
110	format-python-1 format-python-2 \
111	format-pascal-1 format-pascal-2 \
112	format-perl-1 format-perl-2 \
113	format-perl-brace-1 format-perl-brace-2 \
114	format-perl-mixed-1 format-perl-mixed-2 \
115	format-qt-1 format-qt-2 \
116	format-scheme-1 format-scheme-2 \
117	format-sh-1 format-sh-2 \
118	format-tcl-1 format-tcl-2 \
119	format-ycp-1 format-ycp-2 \
120	plural-1 plural-2 \
121	lang-c lang-c++ lang-objc lang-sh lang-bash lang-python-1 \
122	lang-python-2 lang-clisp lang-elisp lang-librep lang-guile \
123	lang-smalltalk lang-java lang-csharp lang-gawk lang-pascal \
124	lang-ycp lang-tcl lang-perl-1 lang-perl-2 lang-php lang-po lang-rst
125
126EXTRA_DIST += $(TESTS) \
127	test.mo xg-c-1.ok.po mex-test2.ok \
128	mm-ko.ascii.pot mm-ko.euc-kr.po mm-ko-comp.euc-kr.po \
129	mm-viet.comp.po mm-viet.pot mm-viet.out \
130	msguniq-a.in msguniq-a.inp msguniq-a.out \
131	qttest_pl.po qttest_pl.qm \
132	qttest2_de.po qttest2_de.qm qttest2_de.ts \
133	ChangeLog.0 \
134	gettext-3-1.po gettext-3-2.po gettext-4.po gettext-5.po \
135	gettext-6-1.po gettext-6-2.po gettext-7.po
136
137XGETTEXT = ../src/xgettext
138
139# For debugging memory leaks and memory allocation bugs.
140# You should build with --disable-shared when using valgrind.
141CHECKER =
142#CHECKER = valgrind --tool=memcheck --suppressions=$(srcdir)/../gnulib-lib/malloca.valgrind --num-callers=20 --leak-check=yes --leak-resolution=high --show-reachable=yes
143#CHECKER = valgrind --tool=massif --format=html --depth=10 --alloc-fn=xmalloc --alloc-fn=xrealloc --stacks=no
144
145TESTS_ENVIRONMENT = top_srcdir=$(top_srcdir) \
146		    PATH=.:../src:../../gettext-runtime/src:$(top_srcdir)/../gettext-runtime/src:$$PATH \
147		    GETTEXT="$(CHECKER) tstgettext" \
148		    NGETTEXT="$(CHECKER) tstngettext" \
149		    XGETTEXT="$(CHECKER) xgettext" \
150		    MSGATTRIB="$(CHECKER) msgattrib" \
151		    MSGCAT="$(CHECKER) msgcat" \
152		    MSGCMP="$(CHECKER) msgcmp" \
153		    MSGCOMM="$(CHECKER) msgcomm" \
154		    MSGCONV="$(CHECKER) msgconv" \
155		    MSGEN="$(CHECKER) msgen" \
156		    MSGEXEC="$(CHECKER) msgexec" \
157		    MSGFILTER="$(CHECKER) msgfilter" \
158		    MSGFMT="$(CHECKER) msgfmt" \
159		    MSGGREP="$(CHECKER) msggrep" \
160		    MSGINIT="$(CHECKER) msginit" \
161		    MSGMERGE="$(CHECKER) msgmerge" \
162		    MSGUNFMT="$(CHECKER) msgunfmt" \
163		    MSGUNIQ="$(CHECKER) msguniq" \
164		    RECODE="$(CHECKER) recode" \
165		    OBJEXT='@OBJEXT@' EXEEXT='@EXEEXT@' \
166		    LIBTOOL='@LIBTOOL@' \
167		    CC='@CC@' CFLAGS='@CFLAGS@' \
168		    CXX='@CXX@' CXXFLAGS='@CXXFLAGS@' \
169		    CPPFLAGS='@CPPFLAGS@' LDFLAGS='@LDFLAGS@' \
170		    LTLIBINTL='@LTLIBINTL@' \
171		    JAVA_CHOICE='@JAVA_CHOICE@' \
172		    BUILDJAVA='@BUILDJAVA@' \
173		    TESTJAVA='@TESTJAVA@' \
174		    CSHARP_CHOICE='@CSHARP_CHOICE@' \
175		    BUILDCSHARP='@BUILDCSHARP@' \
176		    TESTCSHARP='@TESTCSHARP@' \
177		    TESTLIBASPRINTF='@TESTLIBASPRINTF@' \
178		    GLIBC2='@GLIBC2@' \
179		    LOCALE_FR='@LOCALE_FR@' \
180		    LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' \
181		    LOCALE_JA='@LOCALE_JA@' \
182		    host_os='@host_os@' \
183		    CONFIG_SHELL='$(SHELL)' \
184		    $(SHELL)
185
186xg-c-1.ok.po: $(top_srcdir)/src/xgettext.c $(top_srcdir)/src/msgfmt.c
187	$(XGETTEXT) -d xg-c-1.ok -p $(srcdir) \
188	  -k_ --omit-header --no-location \
189	  $(top_srcdir)/src/xgettext.c $(top_srcdir)/src/msgfmt.c
190
191# Three auxiliary programs used by the tests.
192AM_CPPFLAGS = \
193  -I.. \
194  -I../gnulib-lib -I$(top_srcdir)/gnulib-lib \
195  -I../intl
196DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
197# INTL_MACOSX_LIBS is needed because the programs depend on libintl.la
198# but libtool doesn't put -Wl,-framework options into .la files.
199LDADD = $(LDADD_@USE_INCLUDED_LIBINTL@) @INTL_MACOSX_LIBS@
200LDADD_yes = ../intl/libintl.la @LTLIBTHREAD@
201LDADD_no = ../intl/libgnuintl.la @LTLIBTHREAD@ @LTLIBINTL@
202noinst_PROGRAMS = tstgettext tstngettext testlocale gettext-3-prg gettext-4-prg gettext-5-prg gettext-6-prg gettext-7-prg cake fc3 fc4 fc5
203tstgettext_SOURCES = tstgettext.c setlocale.c
204tstgettext_CFLAGS = -DINSTALLDIR=\".\"
205tstgettext_LDADD = ../gnulib-lib/libgettextlib.la $(LDADD)
206tstngettext_SOURCES = tstngettext.c setlocale.c
207tstngettext_CFLAGS = -DINSTALLDIR=\".\"
208tstngettext_LDADD = ../gnulib-lib/libgettextlib.la $(LDADD)
209testlocale_SOURCES = testlocale.c
210gettext_3_prg_SOURCES = gettext-3-prg.c
211gettext_3_prg_LDADD = ../gnulib-lib/libgettextlib.la $(LDADD)
212gettext_4_prg_SOURCES = gettext-4-prg.c
213gettext_4_prg_LDADD = ../gnulib-lib/libgettextlib.la $(LDADD)
214gettext_5_prg_SOURCES = gettext-5-prg.c
215gettext_5_prg_LDADD = ../gnulib-lib/libgettextlib.la $(LDADD)
216gettext_6_prg_SOURCES = gettext-6-prg.c
217gettext_6_prg_CFLAGS = $(gettext_6_prg_CFLAGS_@GLIBC2@)
218gettext_6_prg_CFLAGS_yes = -DUSE_POSIX_THREADS
219gettext_6_prg_LDADD = $(gettext_6_prg_LDADD_@GLIBC2@)
220gettext_6_prg_LDADD_yes = ../gnulib-lib/libgettextlib.la $(LDADD) -lpthread
221gettext_7_prg_SOURCES = gettext-7-prg.c
222gettext_7_prg_CFLAGS = $(gettext_7_prg_CFLAGS_@GLIBC2@)
223gettext_7_prg_CFLAGS_yes = -DUSE_POSIX_THREADS
224gettext_7_prg_LDADD = $(gettext_7_prg_LDADD_@GLIBC2@)
225gettext_7_prg_LDADD_yes = ../gnulib-lib/libgettextlib.la $(LDADD) -lpthread
226cake_SOURCES = plural-1-prg.c setlocale.c
227cake_LDADD = ../gnulib-lib/libgettextlib.la $(LDADD)
228fc3_SOURCES = format-c-3-prg.c setlocale.c
229fc3_LDADD = ../gnulib-lib/libgettextlib.la $(LDADD)
230fc4_SOURCES = format-c-4-prg.c setlocale.c
231fc4_LDADD = ../gnulib-lib/libgettextlib.la $(LDADD)
232fc5_SOURCES = format-c-5-prg.c
233fc5_LDADD = ../gnulib-lib/libgettextlib.la $(LDADD)
234
235# Clean up after Solaris cc.
236clean-local:
237	rm -rf SunWS_cache
238