Update to LGPL v2.1.
[platform/upstream/glibc.git] / locale / Makefile
1 # Copyright (C) 1991, 92, 1995-1999, 2000, 2001 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, write to the Free
16 # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
17 # 02111-1307 USA.
18
19 #
20 #       Makefile for locales.
21 #
22 subdir  := locale
23
24 headers         = locale.h bits/locale.h langinfo.h xlocale.h
25 distribute      = localeinfo.h categories.def iso-639.def iso-3166.def \
26                   iso-4217.def weight.h weightwc.h strlen-hash.h elem-hash.h \
27                   indigits.h indigitswc.h outdigits.h outdigitswc.h \
28                   coll-lookup.h C-translit.h.in C-translit.h gen-translit.pl \
29                   $(addprefix programs/, \
30                               locale.c localedef.c \
31                               $(localedef-modules:=.c) $(locale-modules:=.c) \
32                               $(lib-modules:=.c) config.h simple-hash.h \
33                               charmap-kw.gperf charmap-kw.h locfile-token.h \
34                               locfile-kw.gperf locfile-kw.h linereader.h \
35                               locfile.h charmap.h repertoire.h localedef.h \
36                               3level.h charmap-dir.h)
37 routines        = setlocale findlocale loadlocale localeconv nl_langinfo \
38                   nl_langinfo_l mb_cur_max \
39                   newlocale duplocale freelocale
40 tests           = tst-C-locale
41 categories      = ctype messages monetary numeric time paper name \
42                   address telephone measurement identification collate
43 aux             = $(categories:%=lc-%) $(categories:%=C-%) SYS_libc C_name
44 others          = localedef locale
45 #others-static  = localedef locale
46 install-bin     = localedef locale
47 extra-objs      = $(localedef-modules:=.o) $(locale-modules:=.o) \
48                   $(lib-modules:=.o)
49
50 extra-libs      = libBrokenLocale
51 extra-libs-others = $(extra-libs)
52
53 libBrokenLocale-routines = broken_cur_max
54
55 subdir-dirs     = programs
56 vpath %.c programs
57 vpath %.h programs
58 vpath %.gperf programs
59
60 localedef-modules       := $(categories:%=ld-%) charmap linereader locfile \
61                            repertoire
62 locale-modules          := locale-spec
63 lib-modules             := charmap-dir simple-hash xmalloc xstrdup
64
65
66 GPERF = gperf
67 GPERFFLAGS = -acCgopt -k1,2,5,9,$$ -L ANSI-C
68
69 include ../Rules
70
71 programs/%-kw.h: programs/%-kw.gperf
72         $(GPERF) $(GPERFFLAGS) -N $(@F:-kw.h=_hash) $< > $@.new
73         mv -f $@.new $@
74
75 $(objpfx)localedef: $(localedef-modules:%=$(objpfx)%.o)
76 $(objpfx)locale: $(locale-modules:%=$(objpfx)%.o)
77 $(objpfx)localedef $(objpfx)locale: $(lib-modules:%=$(objpfx)%.o)
78
79 C-translit.h: C-translit.h.in gen-translit.pl
80         $(PERL) gen-translit.pl < $< > $@.tmp
81         mv -f $@.tmp $@
82 ifeq ($(with-cvs),yes)
83         test ! -d CVS || cvs $(CVSOPTS) commit -mRegenerated $@
84 endif
85
86 localepath = "$(localedir):$(i18ndir)"
87
88 locale-CPPFLAGS := -DLOCALE_PATH='$(localepath)' \
89                    -DLOCALEDIR='"$(localedir)"' \
90                    -DLOCALE_ALIAS_PATH='"$(msgcatdir)"' \
91                    -DCHARMAP_PATH='"$(i18ndir)/charmaps"' \
92                    -DREPERTOIREMAP_PATH='"$(i18ndir)/repertoiremaps"' \
93                    -DLOCSRCDIR='"$(i18ndir)/locales"' -DHAVE_CONFIG_H \
94                    -Iprograms
95
96 CFLAGS-charmap.c = -Wno-write-strings -Wno-char-subscripts
97 CFLAGS-locfile.c = -Wno-write-strings -Wno-char-subscripts
98 CFLAGS-charmap-dir.c = -Wno-write-strings
99
100 # Depend on libc.so so a DT_NEEDED is generated in the shared objects.
101 # This ensures they will load libc.so for needed symbols if loaded by
102 # a statically-linked program that hasn't already loaded it.
103 $(objpfx)libBrokenLocale.so: $(common-objpfx)libc.so \
104                              $(common-objpfx)libc_nonshared.a