1 # Copyright (C) 1991,1992,1995-2003,2005,2009,2011,2012
2 # Free Software Foundation, Inc.
3 # This file is part of the GNU C Library.
5 # The GNU C Library is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU Lesser General Public
7 # License as published by the Free Software Foundation; either
8 # version 2.1 of the License, or (at your option) any later version.
10 # The GNU C Library is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # Lesser General Public License for more details.
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with the GNU C Library; if not, see
17 # <http://www.gnu.org/licenses/>.
20 # Makefile for locales.
24 headers
= locale.h bits
/locale.h langinfo.h xlocale.h
25 routines
= setlocale findlocale loadlocale loadarchive \
26 localeconv nl_langinfo nl_langinfo_l mb_cur_max \
27 newlocale duplocale freelocale uselocale
28 tests
= tst-C-locale tst-locname tst-duplocale
29 categories
= ctype messages monetary numeric time paper name \
30 address telephone measurement identification collate
31 aux
= $(categories
:%=lc-
%) $(categories
:%=C-
%) SYS_libc C_name \
32 xlocale localename global-locale coll-lookup
33 others
= localedef locale
34 #others-static = localedef locale
35 install-bin
= localedef locale
36 extra-objs
= $(localedef-modules
:=.o
) $(localedef-aux
:=.o
) \
37 $(locale-modules
:=.o
) $(lib-modules
:=.o
)
39 extra-libs
= libBrokenLocale
40 extra-libs-others
= $(extra-libs
)
42 libBrokenLocale-routines
= broken_cur_max
44 subdir-dirs
= programs
45 vpath
%.c programs ..
/crypt
47 vpath
%.gperf programs
49 localedef-modules
:= localedef
$(categories
:%=ld-
%) \
50 charmap linereader locfile \
53 locale-modules
:= locale locale-spec
54 lib-modules
:= charmap-dir simple-hash xmalloc xstrdup
58 GPERFFLAGS
= -acCgopt
-k1
,2,5,9,$$ -L ANSI-C
62 programs
/%-kw.h
: programs
/%-kw.gperf
64 && $(GPERF
) $(GPERFFLAGS
) -N
$(@F
:-kw.h
=_hash
) $(<F
) > $(@F
).new
67 $(objpfx
)localedef
: $(localedef-modules
:%=$(objpfx
)%.o
)
68 $(objpfx
)localedef
: $(localedef-aux
:%=$(objpfx
)%.o
)
69 $(objpfx
)locale
: $(locale-modules
:%=$(objpfx
)%.o
)
70 $(objpfx
)localedef
$(objpfx
)locale
: $(lib-modules
:%=$(objpfx
)%.o
)
72 C-translit.h
: C-translit.h.in gen-translit.pl
73 $(PERL
) gen-translit.pl
< $< > $@.tmp
76 localepath
= "$(localedir):$(i18ndir)"
78 # -Iprograms doesn't really belong here, but this gets it at the head
79 # of the list instead of the tail, where CPPFLAGS-$(lib) gets added.
80 # We need it before the standard -I's to see programs/config.h first.
81 locale-CPPFLAGS
= -DLOCALEDIR
='"$(localedir)"' \
82 -DLOCALE_ALIAS_PATH
='"$(msgcatdir)"' \
85 CPPFLAGS-locale-programs
= -DLOCALE_PATH
='$(localepath)' \
86 -DCHARMAP_PATH
='"$(i18ndir)/charmaps"' \
87 -DREPERTOIREMAP_PATH
='"$(i18ndir)/repertoiremaps"' \
88 -DLOCSRCDIR
='"$(i18ndir)/locales"' \
89 -DHAVE_CONFIG_H
-DNOT_IN_libc
91 CFLAGS-charmap.c
= -Wno-write-strings
-Wno-char-subscripts
92 CFLAGS-locfile.c
= -Wno-write-strings
-Wno-char-subscripts
93 CFLAGS-charmap-dir.c
= -Wno-write-strings
95 # This makes sure -DNOT_IN_libc et al are passed for all these modules.
96 cpp-srcs-left
:= $(addsuffix .c
,$(localedef-modules
) $(localedef-aux
) \
97 $(locale-modules
) $(lib-modules
))
98 lib
:= locale-programs
99 include $(patsubst %,$(..
)cppflags-iterator.mk
,$(cpp-srcs-left
))
101 # Depend on libc.so so a DT_NEEDED is generated in the shared objects.
102 # This ensures they will load libc.so for needed symbols if loaded by
103 # a statically-linked program that hasn't already loaded it.
104 $(objpfx
)libBrokenLocale.so
: $(common-objpfx
)libc.so \
105 $(common-objpfx
)libc_nonshared.a