]> sourceware.org Git - glibc.git/blob - intl/Makefile
Fix rule dependency in last change.
[glibc.git] / intl / Makefile
1 # Copyright (C) 1995-2003,2005,2008,2011,2012 Free Software Foundation, Inc.
2 # This file is part of the GNU C Library.
3
4 # The GNU C Library is free software; you can redistribute it and/or
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.
8
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
12 # Lesser General Public License for more details.
13
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with the GNU C Library; if not, see
16 # <http://www.gnu.org/licenses/>.
17
18 # Makefile for intl subdirectory: message handling code from GNU gettext.
19
20 subdir = intl
21 headers = libintl.h
22 routines = bindtextdom dcgettext dgettext gettext \
23 dcigettext dcngettext dngettext ngettext \
24 finddomain loadmsgcat localealias textdomain
25 aux = l10nflist explodename plural plural-exp hash-string
26
27 include ../Makeconfig
28
29 multithread-test-srcs := tst-gettext4 tst-gettext5 tst-gettext6
30 test-srcs := tst-gettext tst-translit tst-gettext2 tst-codeset tst-gettext3
31 ifeq ($(have-thread-library),yes)
32 test-srcs += $(multithread-test-srcs)
33 endif
34 tests = tst-ngettext
35
36 before-compile = $(objpfx)msgs.h
37
38 install-others = $(inst_msgcatdir)/locale.alias
39
40 generated = msgs.h mtrace-tst-gettext tst-gettext.mtrace
41 generated-dirs := domaindir localedir
42
43 ifneq (no,$(BISON))
44 plural.c: plural.y
45 $(BISON) $(BISONFLAGS) $@ $^
46 endif
47 $(objpfx)plural.o: plural.c
48
49 include ../Rules
50
51 ifeq (no,$(cross-compiling))
52 ifeq (yes,$(build-shared))
53 ifneq ($(strip $(MSGFMT)),:)
54 tests: $(objpfx)tst-translit.out $(objpfx)tst-gettext2.out \
55 $(objpfx)tst-codeset.out $(objpfx)tst-gettext3.out
56 ifeq ($(have-thread-library),yes)
57 tests: $(objpfx)tst-gettext4.out $(objpfx)tst-gettext5.out \
58 $(objpfx)tst-gettext6.out
59 endif
60 ifneq (no,$(PERL))
61 tests: $(objpfx)mtrace-tst-gettext
62 endif
63 endif
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
69 $(codeset_mo): tstcodeset.po
70 $(make-target-directory)
71 msgfmt -o $@T $<
72 mv -f $@T $@
73
74 $(objpfx)mtrace-tst-gettext: $(objpfx)tst-gettext.out
75 $(common-objpfx)malloc/mtrace $(objpfx)tst-gettext.mtrace > $@
76 $(objpfx)tst-gettext.out: tst-gettext.sh $(objpfx)tst-gettext
77 $(SHELL) -e $< $(common-objpfx) $(common-objpfx)intl/ \
78 $(objpfx)tst-gettext.mtrace
79 $(objpfx)tst-translit.out: tst-translit.sh $(objpfx)tst-translit
80 $(SHELL) -e $< $(common-objpfx) $(common-objpfx)intl/
81 $(objpfx)tst-gettext2.out: tst-gettext2.sh $(objpfx)tst-gettext2
82 $(SHELL) -e $< $(common-objpfx) $(common-objpfx)intl/
83 $(objpfx)tst-gettext4.out: tst-gettext4.sh $(objpfx)tst-gettext4
84 $(SHELL) -e $< $(common-objpfx) '$(run-program-prefix)' $(common-objpfx)intl/
85 $(objpfx)tst-gettext6.out: tst-gettext6.sh $(objpfx)tst-gettext6
86 $(SHELL) -e $< $(common-objpfx) '$(run-program-prefix)' $(common-objpfx)intl/
87
88 $(objpfx)tst-codeset.out: $(codeset_mo)
89 $(objpfx)tst-gettext3.out: $(codeset_mo)
90 $(objpfx)tst-gettext5.out: $(codeset_mo)
91 endif
92 endif
93
94 $(objpfx)msgs.h: po2test.awk ../po/de.po
95 $(make-target-directory)
96 LC_ALL=C $(AWK) -f $^ > $@
97
98 CFLAGS-tst-gettext.c = -DTESTSTRS_H=\"$(objpfx)msgs.h\"
99 CFLAGS-tst-translit.c = -DOBJPFX=\"$(objpfx)\"
100 CFLAGS-tst-gettext2.c = -DOBJPFX=\"$(objpfx)\"
101 CFLAGS-tst-codeset.c = -DOBJPFX=\"$(objpfx)\"
102 CFLAGS-tst-gettext3.c = -DOBJPFX=\"$(objpfx)\"
103 CFLAGS-tst-gettext4.c = -DOBJPFX=\"$(objpfx)\"
104 CFLAGS-tst-gettext5.c = -DOBJPFX=\"$(objpfx)\"
105 CFLAGS-tst-gettext6.c = -DOBJPFX=\"$(objpfx)\"
106
107 LOCPATH-ENV = LOCPATH=$(common-objpfx)localedata
108 tst-codeset-ENV = $(LOCPATH-ENV)
109 tst-gettext3-ENV = $(LOCPATH-ENV)
110 tst-gettext5-ENV = $(LOCPATH-ENV)
111
112 ifeq ($(have-thread-library),yes)
113 ifeq (yes,$(build-shared))
114 $(addprefix $(objpfx),$(multithread-test-srcs)): $(shared-thread-library)
115 else
116 $(addprefix $(objpfx),$(multithread-test-srcs)): $(static-thread-library)
117 endif
118 ifeq (yes,$(build-bounded))
119 $(multithread-test-srcs:%=$(objpfx)%-bp): $(bounded-thread-library)
120 endif
121 endif
122
123 $(objpfx)tst-translit.out: $(objpfx)tst-gettext.out
124 $(objpfx)tst-gettext2.out: $(objpfx)tst-gettext.out
125 $(objpfx)tst-codeset.out: $(objpfx)tst-gettext.out
126 $(objpfx)tst-gettext3.out: $(objpfx)tst-gettext.out
127 $(objpfx)tst-gettext4.out: $(objpfx)tst-gettext.out
128 $(objpfx)tst-gettext5.out: $(objpfx)tst-gettext.out
129 $(objpfx)tst-gettext6.out: $(objpfx)tst-gettext.out
130
131 CPPFLAGS += -D'LOCALEDIR="$(msgcatdir)"' \
132 -D'LOCALE_ALIAS_PATH="$(msgcatdir)"'
133 BISONFLAGS = --yacc --name-prefix=__gettext --output
134
135 $(inst_msgcatdir)/locale.alias: locale.alias $(+force)
136 $(do-install)
This page took 0.050948 seconds and 6 git commands to generate.