Consistently include Makeconfig after defining subdir.
[glibc.git] / intl / Makefile
blobb21f4d92956661c24a1a0ff4f234775267ed196e
1 # Copyright (C) 1995-2014 Free Software Foundation, Inc.
2 # This file is part of the GNU C Library.
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.
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.
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/>.
18 # Makefile for intl subdirectory: message handling code from GNU gettext.
20 subdir = intl
22 include ../Makeconfig
24 headers = libintl.h
25 routines = bindtextdom dcgettext dgettext gettext \
26 dcigettext dcngettext dngettext ngettext \
27 finddomain loadmsgcat localealias textdomain
28 aux = l10nflist explodename plural plural-exp hash-string
30 multithread-test-srcs := tst-gettext4 tst-gettext5 tst-gettext6
31 test-srcs := tst-gettext tst-translit tst-gettext2 tst-codeset tst-gettext3
32 ifeq ($(have-thread-library),yes)
33 test-srcs += $(multithread-test-srcs)
34 endif
35 tests = tst-ngettext
37 before-compile = $(objpfx)msgs.h
39 install-others = $(inst_msgcatdir)/locale.alias
41 generated = msgs.h mtrace-tst-gettext tst-gettext.mtrace
42 generated-dirs := domaindir localedir
44 ifneq (no,$(BISON))
45 plural.c: plural.y
46 $(BISON) $(BISONFLAGS) $@ $^
47 endif
48 $(objpfx)plural.o: plural.c
50 include ../Rules
52 ifeq ($(run-built-tests),yes)
53 ifeq (yes,$(build-shared))
54 ifneq ($(strip $(MSGFMT)),:)
55 tests: $(objpfx)tst-translit.out $(objpfx)tst-gettext2.out \
56 $(objpfx)tst-codeset.out $(objpfx)tst-gettext3.out
57 ifeq ($(have-thread-library),yes)
58 tests: $(objpfx)tst-gettext4.out $(objpfx)tst-gettext5.out \
59 $(objpfx)tst-gettext6.out
60 endif
61 ifneq (no,$(PERL))
62 tests: $(objpfx)mtrace-tst-gettext
63 endif
64 endif
66 # Multiple tests use this data. Create it once to avoid racing and
67 # spurious test failures.
68 codeset_mo = $(objpfx)domaindir/de_DE/LC_MESSAGES/codeset.mo
70 $(codeset_mo): tstcodeset.po
71 $(make-target-directory)
72 msgfmt -o $@T $<
73 mv -f $@T $@
75 $(objpfx)mtrace-tst-gettext: $(objpfx)tst-gettext.out
76 $(common-objpfx)malloc/mtrace $(objpfx)tst-gettext.mtrace > $@; \
77 $(evaluate-test)
78 $(objpfx)tst-gettext.out: tst-gettext.sh $(objpfx)tst-gettext
79 $(SHELL) $< $(common-objpfx) '$(test-program-prefix)' \
80 $(common-objpfx)intl/ $(objpfx)tst-gettext.mtrace; \
81 $(evaluate-test)
82 $(objpfx)tst-translit.out: tst-translit.sh $(objpfx)tst-translit
83 $(SHELL) $< $(common-objpfx) '$(test-program-prefix)' \
84 $(common-objpfx)intl/; \
85 $(evaluate-test)
86 $(objpfx)tst-gettext2.out: tst-gettext2.sh $(objpfx)tst-gettext2
87 $(SHELL) $< $(common-objpfx) '$(test-program-prefix)' \
88 $(common-objpfx)intl/; \
89 $(evaluate-test)
90 $(objpfx)tst-gettext4.out: tst-gettext4.sh $(objpfx)tst-gettext4
91 $(SHELL) $< $(common-objpfx) '$(test-program-prefix)' $(common-objpfx)intl/; \
92 $(evaluate-test)
93 $(objpfx)tst-gettext6.out: tst-gettext6.sh $(objpfx)tst-gettext6
94 $(SHELL) $< $(common-objpfx) '$(test-program-prefix)' $(common-objpfx)intl/; \
95 $(evaluate-test)
97 $(objpfx)tst-codeset.out: $(codeset_mo)
98 $(objpfx)tst-gettext3.out: $(codeset_mo)
99 $(objpfx)tst-gettext5.out: $(codeset_mo)
100 endif
101 endif
103 $(objpfx)msgs.h: po2test.awk ../po/de.po
104 $(make-target-directory)
105 LC_ALL=C $(AWK) -f $^ > $@
107 CFLAGS-tst-gettext.c = -DTESTSTRS_H=\"$(objpfx)msgs.h\"
108 CFLAGS-tst-translit.c = -DOBJPFX=\"$(objpfx)\"
109 CFLAGS-tst-gettext2.c = -DOBJPFX=\"$(objpfx)\"
110 CFLAGS-tst-codeset.c = -DOBJPFX=\"$(objpfx)\"
111 CFLAGS-tst-gettext3.c = -DOBJPFX=\"$(objpfx)\"
112 CFLAGS-tst-gettext4.c = -DOBJPFX=\"$(objpfx)\"
113 CFLAGS-tst-gettext5.c = -DOBJPFX=\"$(objpfx)\"
114 CFLAGS-tst-gettext6.c = -DOBJPFX=\"$(objpfx)\"
116 LOCPATH-ENV = LOCPATH=$(common-objpfx)localedata
117 tst-codeset-ENV = $(LOCPATH-ENV)
118 tst-gettext3-ENV = $(LOCPATH-ENV)
119 tst-gettext5-ENV = $(LOCPATH-ENV)
121 ifeq ($(have-thread-library),yes)
122 ifeq (yes,$(build-shared))
123 $(addprefix $(objpfx),$(multithread-test-srcs)): $(shared-thread-library)
124 else
125 $(addprefix $(objpfx),$(multithread-test-srcs)): $(static-thread-library)
126 endif
127 endif
129 $(objpfx)tst-translit.out: $(objpfx)tst-gettext.out
130 $(objpfx)tst-gettext2.out: $(objpfx)tst-gettext.out
131 $(objpfx)tst-codeset.out: $(objpfx)tst-gettext.out
132 $(objpfx)tst-gettext3.out: $(objpfx)tst-gettext.out
133 $(objpfx)tst-gettext4.out: $(objpfx)tst-gettext.out
134 $(objpfx)tst-gettext5.out: $(objpfx)tst-gettext.out
135 $(objpfx)tst-gettext6.out: $(objpfx)tst-gettext.out
137 CPPFLAGS += -D'LOCALEDIR="$(msgcatdir)"' \
138 -D'LOCALE_ALIAS_PATH="$(msgcatdir)"'
139 BISONFLAGS = --yacc --name-prefix=__gettext --output
141 $(inst_msgcatdir)/locale.alias: locale.alias $(+force)
142 $(do-install)