Replace FSF snail mail address with URLs.
[platform/upstream/glibc.git] / locale / Makefile
1 # Copyright (C) 1991,1992,1995-2003,2005,2009,2011
2 # Free Software Foundation, Inc.
3 # This file is part of the GNU C Library.
4
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.
9
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.
14
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/>.
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                   locarchive.h hashval.h \
30                   $(addprefix programs/, \
31                               locale.c localedef.c \
32                               $(localedef-modules:=.c) $(locale-modules:=.c) \
33                               $(lib-modules:=.c) config.h simple-hash.h \
34                               charmap-kw.gperf charmap-kw.h locfile-token.h \
35                               locfile-kw.gperf locfile-kw.h linereader.h \
36                               locfile.h charmap.h repertoire.h localedef.h \
37                               3level.h charmap-dir.h locarchive.c)
38 routines        = setlocale findlocale loadlocale loadarchive \
39                   localeconv nl_langinfo nl_langinfo_l mb_cur_max \
40                   newlocale duplocale freelocale uselocale
41 tests           = tst-C-locale tst-locname tst-duplocale
42 categories      = ctype messages monetary numeric time paper name \
43                   address telephone measurement identification collate
44 aux             = $(categories:%=lc-%) $(categories:%=C-%) SYS_libc C_name \
45                   xlocale localename global-locale coll-lookup
46 others          = localedef locale
47 #others-static  = localedef locale
48 install-bin     = localedef locale
49 extra-objs      = $(localedef-modules:=.o) $(localedef-aux:=.o) \
50                   $(locale-modules:=.o) $(lib-modules:=.o)
51
52 extra-libs      = libBrokenLocale
53 extra-libs-others = $(extra-libs)
54
55 libBrokenLocale-routines = broken_cur_max
56
57 subdir-dirs     = programs
58 vpath %.c programs ../crypt
59 vpath %.h programs
60 vpath %.gperf programs
61
62 localedef-modules       := localedef $(categories:%=ld-%) \
63                            charmap linereader locfile \
64                            repertoire locarchive
65 localedef-aux           := md5
66 locale-modules          := locale locale-spec
67 lib-modules             := charmap-dir simple-hash xmalloc xstrdup
68
69
70 GPERF = gperf
71 GPERFFLAGS = -acCgopt -k1,2,5,9,$$ -L ANSI-C
72
73 include ../Rules
74
75 programs/%-kw.h: programs/%-kw.gperf
76         cd programs \
77         && $(GPERF) $(GPERFFLAGS) -N $(@F:-kw.h=_hash) $(<F) > $(@F).new
78         mv -f $@.new $@
79
80 $(objpfx)localedef: $(localedef-modules:%=$(objpfx)%.o)
81 $(objpfx)localedef: $(localedef-aux:%=$(objpfx)%.o)
82 $(objpfx)locale: $(locale-modules:%=$(objpfx)%.o)
83 $(objpfx)localedef $(objpfx)locale: $(lib-modules:%=$(objpfx)%.o)
84
85 C-translit.h: C-translit.h.in gen-translit.pl
86         $(PERL) gen-translit.pl < $< > $@.tmp
87         mv -f $@.tmp $@
88
89 localepath = "$(localedir):$(i18ndir)"
90
91 # -Iprograms doesn't really belong here, but this gets it at the head
92 # of the list instead of the tail, where CPPFLAGS-$(lib) gets added.
93 # We need it before the standard -I's to see programs/config.h first.
94 locale-CPPFLAGS = -DLOCALEDIR='"$(localedir)"' \
95                   -DLOCALE_ALIAS_PATH='"$(msgcatdir)"' \
96                   -Iprograms
97
98 CPPFLAGS-locale-programs = -DLOCALE_PATH='$(localepath)' \
99                            -DCHARMAP_PATH='"$(i18ndir)/charmaps"' \
100                            -DREPERTOIREMAP_PATH='"$(i18ndir)/repertoiremaps"' \
101                            -DLOCSRCDIR='"$(i18ndir)/locales"' \
102                            -DHAVE_CONFIG_H -DNOT_IN_libc
103
104 CFLAGS-charmap.c = -Wno-write-strings -Wno-char-subscripts
105 CFLAGS-locfile.c = -Wno-write-strings -Wno-char-subscripts
106 CFLAGS-charmap-dir.c = -Wno-write-strings
107
108 # This makes sure -DNOT_IN_libc et al are passed for all these modules.
109 cpp-srcs-left := $(addsuffix .c,$(localedef-modules) $(localedef-aux) \
110                                 $(locale-modules) $(lib-modules))
111 lib := locale-programs
112 include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
113
114 # Depend on libc.so so a DT_NEEDED is generated in the shared objects.
115 # This ensures they will load libc.so for needed symbols if loaded by
116 # a statically-linked program that hasn't already loaded it.
117 $(objpfx)libBrokenLocale.so: $(common-objpfx)libc.so \
118                              $(common-objpfx)libc_nonshared.a