ce9747bd00012aeec3baffb2ffa5760ff38342f5
[platform/upstream/glibc.git] / locale / Makefile
1 # Copyright (C) 1991, 92, 1995-1999, 2000 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 Library General Public License as
6 # published by the Free Software Foundation; either version 2 of the
7 # 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 # Library General Public License for more details.
13
14 # You should have received a copy of the GNU Library General Public
15 # License along with the GNU C Library; see the file COPYING.LIB.  If not,
16 # write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 # Boston, MA 02111-1307, USA.
18
19 #
20 #       Makefile for locales.
21 #
22 subdir  := locale
23
24 headers         = 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)
37 routines        = setlocale findlocale loadlocale localeconv nl_langinfo \
38                   mb_cur_max codeset_name \
39                   newlocale duplocale freelocale
40 categories      = ctype messages monetary numeric time paper name \
41                   address telephone measurement identification collate
42 aux             = $(categories:%=lc-%) $(categories:%=C-%) SYS_libc C_name
43 others          = localedef locale
44 #others-static  = localedef locale
45 install-bin     = localedef locale
46 extra-objs      = $(localedef-modules:=.o) $(locale-modules:=.o) \
47                   $(lib-modules:=.o)
48
49 extra-libs      = libBrokenLocale
50 extra-libs-others = $(extra-libs)
51
52 libBrokenLocale-routines = broken_cur_max
53
54 subdir-dirs     = programs
55 vpath %.c programs
56 vpath %.h programs
57 vpath %.gperf programs
58
59 localedef-modules       := $(categories:%=ld-%) charmap linereader locfile \
60                            repertoire
61 locale-modules          := locale-spec
62 lib-modules             := simple-hash xmalloc xstrdup
63
64
65 GPERF = gperf
66 GPERFFLAGS = -acCgopt -k1,2,5,9,$$ -L ANSI-C
67
68 include ../Rules
69
70 programs/%-kw.h: programs/%-kw.gperf
71         $(GPERF) $(GPERFFLAGS) -N $(@F:-kw.h=_hash) $< > $@.new
72         mv -f $@.new $@
73
74 $(objpfx)localedef: $(localedef-modules:%=$(objpfx)%.o)
75 $(objpfx)locale: $(locale-modules:%=$(objpfx)%.o)
76 $(objpfx)localedef $(objpfx)locale: $(lib-modules:%=$(objpfx)%.o)
77
78 C-translit.h: C-translit.h.in gen-translit.pl
79         $(PERL) gen-translit.pl < $< > $@.tmp
80         mv -f $@.tmp $@
81 ifeq ($(with-cvs),yes)
82         test ! -d CVS || cvs $(CVSOPTS) commit -mRegenerated $@
83 endif
84
85 localepath = "$(localedir):$(i18ndir)"
86
87 locale-CPPFLAGS := -DLOCALE_PATH='$(localepath)' \
88                    -DLOCALEDIR='"$(localedir)"' \
89                    -DLOCALE_ALIAS_PATH='"$(msgcatdir)"' \
90                    -DCHARMAP_PATH='"$(i18ndir)/charmaps"' \
91                    -DREPERTOIREMAP_PATH='"$(i18ndir)/repertoiremaps"' \
92                    -DLOCSRCDIR='"$(i18ndir)/locales"' -DHAVE_CONFIG_H \
93                    -Iprograms
94
95 CFLAGS-charmap.c = -Wno-write-strings -Wno-char-subscripts
96 CFLAGS-locfile.c = -Wno-write-strings -Wno-char-subscripts
97
98 # Depend on libc.so so a DT_NEEDED is generated in the shared objects.
99 # This ensures they will load libc.so for needed symbols if loaded by
100 # a statically-linked program that hasn't already loaded it.
101 $(objpfx)libBrokenLocale.so: $(common-objpfx)libc.so