]>
Commit | Line | Data |
---|---|---|
d4697bc9 | 1 | # Copyright (C) 1995-2014 Free Software Foundation, Inc. |
91c7b85d | 2 | # This file is part of the GNU C Library. |
41cfadd6 | 3 | |
91c7b85d | 4 | # The GNU C Library is free software; you can redistribute it and/or |
41bdb6e2 AJ |
5 | # modify it under the terms of the GNU Lesser General Public |
6 | # License as published by the Free Software Foundation; either | |
7 | # version 2.1 of the License, or (at your option) any later version. | |
41cfadd6 | 8 | |
91c7b85d RM |
9 | # The GNU C Library 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 GNU | |
41bdb6e2 | 12 | # Lesser General Public License for more details. |
41cfadd6 | 13 | |
41bdb6e2 | 14 | # You should have received a copy of the GNU Lesser General Public |
59ba27a6 PE |
15 | # License along with the GNU C Library; if not, see |
16 | # <http://www.gnu.org/licenses/>. | |
0c5ecdc4 UD |
17 | |
18 | # Makefile for intl subdirectory: message handling code from GNU gettext. | |
41cfadd6 | 19 | |
24906b43 | 20 | subdir = intl |
91c7b85d RM |
21 | headers = libintl.h |
22 | routines = bindtextdom dcgettext dgettext gettext \ | |
abbffdf9 | 23 | dcigettext dcngettext dngettext ngettext \ |
dd9423a6 UD |
24 | finddomain loadmsgcat localealias textdomain |
25 | aux = l10nflist explodename plural plural-exp hash-string | |
9a79284e | 26 | |
8406a53a UD |
27 | include ../Makeconfig |
28 | ||
2ecc7d93 | 29 | multithread-test-srcs := tst-gettext4 tst-gettext5 tst-gettext6 |
9a79284e | 30 | test-srcs := tst-gettext tst-translit tst-gettext2 tst-codeset tst-gettext3 |
8406a53a UD |
31 | ifeq ($(have-thread-library),yes) |
32 | test-srcs += $(multithread-test-srcs) | |
33 | endif | |
1267f93e | 34 | tests = tst-ngettext |
abbffdf9 UD |
35 | |
36 | before-compile = $(objpfx)msgs.h | |
7a12c6bb | 37 | |
4a33c2f5 | 38 | install-others = $(inst_msgcatdir)/locale.alias |
24906b43 | 39 | |
b025588a | 40 | generated = msgs.h mtrace-tst-gettext tst-gettext.mtrace |
cdfb970d | 41 | generated-dirs := domaindir localedir |
a1d84548 | 42 | |
ae113383 | 43 | ifneq (no,$(BISON)) |
abbffdf9 | 44 | plural.c: plural.y |
ae113383 | 45 | $(BISON) $(BISONFLAGS) $@ $^ |
199745d1 | 46 | endif |
abbffdf9 UD |
47 | $(objpfx)plural.o: plural.c |
48 | ||
91c7b85d | 49 | include ../Rules |
24906b43 | 50 | |
03ac099f | 51 | ifeq ($(run-built-tests),yes) |
7d4de961 | 52 | ifeq (yes,$(build-shared)) |
328c5f65 | 53 | ifneq ($(strip $(MSGFMT)),:) |
c44a663d | 54 | tests: $(objpfx)tst-translit.out $(objpfx)tst-gettext2.out \ |
9a79284e | 55 | $(objpfx)tst-codeset.out $(objpfx)tst-gettext3.out |
8406a53a | 56 | ifeq ($(have-thread-library),yes) |
2ecc7d93 UD |
57 | tests: $(objpfx)tst-gettext4.out $(objpfx)tst-gettext5.out \ |
58 | $(objpfx)tst-gettext6.out | |
8406a53a | 59 | endif |
89e89345 AJ |
60 | ifneq (no,$(PERL)) |
61 | tests: $(objpfx)mtrace-tst-gettext | |
62 | endif | |
d4eaa8bb | 63 | endif |
d1f09384 JL |
64 | |
65 | # Multiple tests use this data. Create it once to avoid racing and | |
66 | # spurious test failures. | |
67 | codeset_mo = $(objpfx)domaindir/de_DE/LC_MESSAGES/codeset.mo | |
68 | ||
3bd9e993 | 69 | $(codeset_mo): tstcodeset.po |
d1f09384 | 70 | $(make-target-directory) |
3bd9e993 | 71 | msgfmt -o $@T $< |
d1f09384 JL |
72 | mv -f $@T $@ |
73 | ||
6baa3368 | 74 | $(objpfx)mtrace-tst-gettext: $(objpfx)tst-gettext.out |
55e2d5c7 | 75 | $(common-objpfx)malloc/mtrace $(objpfx)tst-gettext.mtrace > $@ |
4ab8e75a | 76 | $(objpfx)tst-gettext.out: tst-gettext.sh $(objpfx)tst-gettext |
740b3dbe | 77 | $(SHELL) $< $(common-objpfx) '$(test-program-prefix)' \ |
e40a0d21 | 78 | $(common-objpfx)intl/ $(objpfx)tst-gettext.mtrace |
4ab8e75a | 79 | $(objpfx)tst-translit.out: tst-translit.sh $(objpfx)tst-translit |
740b3dbe | 80 | $(SHELL) $< $(common-objpfx) '$(test-program-prefix)' \ |
e40a0d21 | 81 | $(common-objpfx)intl/ |
cdfb970d | 82 | $(objpfx)tst-gettext2.out: tst-gettext2.sh $(objpfx)tst-gettext2 |
740b3dbe | 83 | $(SHELL) $< $(common-objpfx) '$(test-program-prefix)' \ |
e40a0d21 | 84 | $(common-objpfx)intl/ |
8406a53a | 85 | $(objpfx)tst-gettext4.out: tst-gettext4.sh $(objpfx)tst-gettext4 |
740b3dbe | 86 | $(SHELL) $< $(common-objpfx) '$(test-program-prefix)' $(common-objpfx)intl/ |
2ecc7d93 | 87 | $(objpfx)tst-gettext6.out: tst-gettext6.sh $(objpfx)tst-gettext6 |
740b3dbe | 88 | $(SHELL) $< $(common-objpfx) '$(test-program-prefix)' $(common-objpfx)intl/ |
d1f09384 JL |
89 | |
90 | $(objpfx)tst-codeset.out: $(codeset_mo) | |
91 | $(objpfx)tst-gettext3.out: $(codeset_mo) | |
92 | $(objpfx)tst-gettext5.out: $(codeset_mo) | |
7d4de961 | 93 | endif |
955ebce4 | 94 | endif |
abbffdf9 | 95 | |
70d35b67 | 96 | $(objpfx)msgs.h: po2test.awk ../po/de.po |
4974d2b2 | 97 | $(make-target-directory) |
70d35b67 | 98 | LC_ALL=C $(AWK) -f $^ > $@ |
abbffdf9 UD |
99 | |
100 | CFLAGS-tst-gettext.c = -DTESTSTRS_H=\"$(objpfx)msgs.h\" | |
a334319f | 101 | CFLAGS-tst-translit.c = -DOBJPFX=\"$(objpfx)\" |
9a79284e | 102 | CFLAGS-tst-gettext2.c = -DOBJPFX=\"$(objpfx)\" |
c44a663d | 103 | CFLAGS-tst-codeset.c = -DOBJPFX=\"$(objpfx)\" |
9a79284e | 104 | CFLAGS-tst-gettext3.c = -DOBJPFX=\"$(objpfx)\" |
8406a53a UD |
105 | CFLAGS-tst-gettext4.c = -DOBJPFX=\"$(objpfx)\" |
106 | CFLAGS-tst-gettext5.c = -DOBJPFX=\"$(objpfx)\" | |
2ecc7d93 | 107 | CFLAGS-tst-gettext6.c = -DOBJPFX=\"$(objpfx)\" |
8406a53a | 108 | |
d1f09384 JL |
109 | LOCPATH-ENV = LOCPATH=$(common-objpfx)localedata |
110 | tst-codeset-ENV = $(LOCPATH-ENV) | |
111 | tst-gettext3-ENV = $(LOCPATH-ENV) | |
112 | tst-gettext5-ENV = $(LOCPATH-ENV) | |
113 | ||
8406a53a UD |
114 | ifeq ($(have-thread-library),yes) |
115 | ifeq (yes,$(build-shared)) | |
116 | $(addprefix $(objpfx),$(multithread-test-srcs)): $(shared-thread-library) | |
117 | else | |
118 | $(addprefix $(objpfx),$(multithread-test-srcs)): $(static-thread-library) | |
119 | endif | |
8406a53a | 120 | endif |
abbffdf9 | 121 | |
c6df09ad | 122 | $(objpfx)tst-translit.out: $(objpfx)tst-gettext.out |
8f13e320 UD |
123 | $(objpfx)tst-gettext2.out: $(objpfx)tst-gettext.out |
124 | $(objpfx)tst-codeset.out: $(objpfx)tst-gettext.out | |
9a79284e | 125 | $(objpfx)tst-gettext3.out: $(objpfx)tst-gettext.out |
8406a53a UD |
126 | $(objpfx)tst-gettext4.out: $(objpfx)tst-gettext.out |
127 | $(objpfx)tst-gettext5.out: $(objpfx)tst-gettext.out | |
2ecc7d93 | 128 | $(objpfx)tst-gettext6.out: $(objpfx)tst-gettext.out |
c6df09ad | 129 | |
4a4d50f3 | 130 | CPPFLAGS += -D'LOCALEDIR="$(msgcatdir)"' \ |
835bf8e0 | 131 | -D'LOCALE_ALIAS_PATH="$(msgcatdir)"' |
ae113383 | 132 | BISONFLAGS = --yacc --name-prefix=__gettext --output |
7a12c6bb | 133 | |
4a33c2f5 | 134 | $(inst_msgcatdir)/locale.alias: locale.alias $(+force) |
7a12c6bb | 135 | $(do-install) |