]>
Commit | Line | Data |
---|---|---|
04277e02 | 1 | # Copyright (C) 1995-2019 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 |
a5f891ac JM |
21 | |
22 | include ../Makeconfig | |
23 | ||
91c7b85d RM |
24 | headers = libintl.h |
25 | routines = bindtextdom dcgettext dgettext gettext \ | |
abbffdf9 | 26 | dcigettext dcngettext dngettext ngettext \ |
dd9423a6 UD |
27 | finddomain loadmsgcat localealias textdomain |
28 | aux = l10nflist explodename plural plural-exp hash-string | |
9a79284e | 29 | |
2ecc7d93 | 30 | multithread-test-srcs := tst-gettext4 tst-gettext5 tst-gettext6 |
9a79284e | 31 | test-srcs := tst-gettext tst-translit tst-gettext2 tst-codeset tst-gettext3 |
8406a53a UD |
32 | ifeq ($(have-thread-library),yes) |
33 | test-srcs += $(multithread-test-srcs) | |
34 | endif | |
1267f93e | 35 | tests = tst-ngettext |
abbffdf9 | 36 | |
f08e9a26 | 37 | before-compile += $(objpfx)msgs.h |
7a12c6bb | 38 | |
314f6dee | 39 | install-others = $(inst_localedir)/locale.alias |
24906b43 | 40 | |
1faaf703 | 41 | generated += msgs.h mtrace-tst-gettext.out tst-gettext.mtrace plural.c |
f08e9a26 | 42 | generated-dirs += domaindir localedir |
a1d84548 | 43 | |
1faaf703 | 44 | $(objpfx)plural.c: plural.y |
ef9ecfa6 | 45 | $(make-target-directory) |
ae113383 | 46 | $(BISON) $(BISONFLAGS) $@ $^ |
1faaf703 JB |
47 | |
48 | $(objpfx)plural.o: $(objpfx)plural.c | |
abbffdf9 | 49 | |
03ac099f | 50 | ifeq ($(run-built-tests),yes) |
7d4de961 | 51 | ifeq (yes,$(build-shared)) |
328c5f65 | 52 | ifneq ($(strip $(MSGFMT)),:) |
f214606a JM |
53 | tests-special += $(objpfx)tst-translit.out $(objpfx)tst-gettext.out \ |
54 | $(objpfx)tst-gettext2.out $(objpfx)tst-codeset.out \ | |
55 | $(objpfx)tst-gettext3.out | |
8406a53a | 56 | ifeq ($(have-thread-library),yes) |
f214606a JM |
57 | tests-special += $(objpfx)tst-gettext4.out $(objpfx)tst-gettext5.out \ |
58 | $(objpfx)tst-gettext6.out | |
8406a53a | 59 | endif |
89e89345 | 60 | ifneq (no,$(PERL)) |
0b20a9e8 | 61 | tests-special += $(objpfx)mtrace-tst-gettext.out |
f214606a JM |
62 | endif |
63 | endif | |
89e89345 | 64 | endif |
d4eaa8bb | 65 | endif |
d1f09384 | 66 | |
f214606a JM |
67 | include ../Rules |
68 | ||
69 | ifeq ($(run-built-tests),yes) | |
70 | ifeq (yes,$(build-shared)) | |
d1f09384 JL |
71 | # Multiple tests use this data. Create it once to avoid racing and |
72 | # spurious test failures. | |
73 | codeset_mo = $(objpfx)domaindir/de_DE/LC_MESSAGES/codeset.mo | |
74 | ||
3bd9e993 | 75 | $(codeset_mo): tstcodeset.po |
d1f09384 | 76 | $(make-target-directory) |
3bd9e993 | 77 | msgfmt -o $@T $< |
d1f09384 JL |
78 | mv -f $@T $@ |
79 | ||
0b20a9e8 | 80 | $(objpfx)mtrace-tst-gettext.out: $(objpfx)tst-gettext.out |
f0881698 JM |
81 | $(common-objpfx)malloc/mtrace $(objpfx)tst-gettext.mtrace > $@; \ |
82 | $(evaluate-test) | |
4ab8e75a | 83 | $(objpfx)tst-gettext.out: tst-gettext.sh $(objpfx)tst-gettext |
8540f6d2 JM |
84 | $(SHELL) $< $(common-objpfx) '$(test-program-prefix-before-env)' \ |
85 | '$(run-program-env)' '$(test-program-prefix-after-env)' \ | |
d5afb385 | 86 | $(common-objpfx)intl/ $(objpfx)tst-gettext.mtrace > $@; \ |
f0881698 | 87 | $(evaluate-test) |
4ab8e75a | 88 | $(objpfx)tst-translit.out: tst-translit.sh $(objpfx)tst-translit |
740b3dbe | 89 | $(SHELL) $< $(common-objpfx) '$(test-program-prefix)' \ |
d5afb385 | 90 | $(common-objpfx)intl/ > $@; \ |
f0881698 | 91 | $(evaluate-test) |
cdfb970d | 92 | $(objpfx)tst-gettext2.out: tst-gettext2.sh $(objpfx)tst-gettext2 |
8540f6d2 JM |
93 | $(SHELL) $< $(common-objpfx) '$(test-program-prefix-before-env)' \ |
94 | '$(run-program-env)' '$(test-program-prefix-after-env)' \ | |
d5afb385 | 95 | $(common-objpfx)intl/ > $@; \ |
f0881698 | 96 | $(evaluate-test) |
8406a53a | 97 | $(objpfx)tst-gettext4.out: tst-gettext4.sh $(objpfx)tst-gettext4 |
d5afb385 | 98 | $(SHELL) $< $(common-objpfx) '$(test-program-prefix)' $(common-objpfx)intl/ > $@; \ |
f0881698 | 99 | $(evaluate-test) |
2ecc7d93 | 100 | $(objpfx)tst-gettext6.out: tst-gettext6.sh $(objpfx)tst-gettext6 |
d5afb385 | 101 | $(SHELL) $< $(common-objpfx) '$(test-program-prefix)' $(common-objpfx)intl/ > $@; \ |
f0881698 | 102 | $(evaluate-test) |
d1f09384 JL |
103 | |
104 | $(objpfx)tst-codeset.out: $(codeset_mo) | |
105 | $(objpfx)tst-gettext3.out: $(codeset_mo) | |
106 | $(objpfx)tst-gettext5.out: $(codeset_mo) | |
7d4de961 | 107 | endif |
f881f6ff AS |
108 | |
109 | LOCALES := de_DE.ISO-8859-1 de_DE.UTF-8 en_US.ANSI_X3.4-1968 fr_FR.ISO-8859-1 \ | |
110 | ja_JP.UTF-8 | |
111 | include ../gen-locales.mk | |
112 | ||
113 | $(objpfx)tst-codeset.out: $(gen-locales) | |
114 | $(objpfx)tst-gettext.out: $(gen-locales) | |
115 | $(objpfx)tst-gettext2.out: $(gen-locales) | |
116 | $(objpfx)tst-gettext3.out: $(gen-locales) | |
117 | $(objpfx)tst-gettext4.out: $(gen-locales) | |
118 | $(objpfx)tst-gettext5.out: $(gen-locales) | |
119 | $(objpfx)tst-gettext6.out: $(gen-locales) | |
120 | $(objpfx)tst-translit.out: $(gen-locales) | |
955ebce4 | 121 | endif |
abbffdf9 | 122 | |
56456a2a AJ |
123 | $(objpfx)tst-gettext-de.po: ../po/de.po |
124 | $(make-target-directory) | |
125 | LC_ALL=C $(AWK) '!/^"POT-Creation-Date: [0-9-]+ [0-9:+-]+\\n"$$/' $^ > $@ | |
126 | ||
127 | $(objpfx)msgs.h: po2test.awk $(objpfx)tst-gettext-de.po | |
4974d2b2 | 128 | $(make-target-directory) |
70d35b67 | 129 | LC_ALL=C $(AWK) -f $^ > $@ |
abbffdf9 | 130 | |
36975e8e L |
131 | CFLAGS-tst-gettext.c += -DTESTSTRS_H=\"$(objpfx)msgs.h\" |
132 | CFLAGS-tst-translit.c += -DOBJPFX=\"$(objpfx)\" | |
133 | CFLAGS-tst-gettext2.c += -DOBJPFX=\"$(objpfx)\" | |
134 | CFLAGS-tst-codeset.c += -DOBJPFX=\"$(objpfx)\" | |
135 | CFLAGS-tst-gettext3.c += -DOBJPFX=\"$(objpfx)\" | |
136 | CFLAGS-tst-gettext4.c += -DOBJPFX=\"$(objpfx)\" | |
137 | CFLAGS-tst-gettext5.c += -DOBJPFX=\"$(objpfx)\" | |
138 | CFLAGS-tst-gettext6.c += -DOBJPFX=\"$(objpfx)\" | |
8406a53a UD |
139 | |
140 | ifeq ($(have-thread-library),yes) | |
141 | ifeq (yes,$(build-shared)) | |
142 | $(addprefix $(objpfx),$(multithread-test-srcs)): $(shared-thread-library) | |
143 | else | |
144 | $(addprefix $(objpfx),$(multithread-test-srcs)): $(static-thread-library) | |
145 | endif | |
8406a53a | 146 | endif |
abbffdf9 | 147 | |
c6df09ad | 148 | $(objpfx)tst-translit.out: $(objpfx)tst-gettext.out |
8f13e320 UD |
149 | $(objpfx)tst-gettext2.out: $(objpfx)tst-gettext.out |
150 | $(objpfx)tst-codeset.out: $(objpfx)tst-gettext.out | |
9a79284e | 151 | $(objpfx)tst-gettext3.out: $(objpfx)tst-gettext.out |
8406a53a UD |
152 | $(objpfx)tst-gettext4.out: $(objpfx)tst-gettext.out |
153 | $(objpfx)tst-gettext5.out: $(objpfx)tst-gettext.out | |
2ecc7d93 | 154 | $(objpfx)tst-gettext6.out: $(objpfx)tst-gettext.out |
c6df09ad | 155 | |
314f6dee CD |
156 | CPPFLAGS += -D'LOCALEDIR="$(localedir)"' \ |
157 | -D'LOCALE_ALIAS_PATH="$(localedir)"' | |
ae113383 | 158 | BISONFLAGS = --yacc --name-prefix=__gettext --output |
7a12c6bb | 159 | |
314f6dee | 160 | $(inst_localedir)/locale.alias: locale.alias $(+force) |
7a12c6bb | 161 | $(do-install) |