]> git.ipfire.org Git - thirdparty/glibc.git/blame - locale/Makefile
setlocale: Use the heap for the copy of the locale argument
[thirdparty/glibc.git] / locale / Makefile
CommitLineData
d4697bc9 1# Copyright (C) 1991-2014 Free Software Foundation, Inc.
28f540f4
RM
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
41bdb6e2
AJ
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.
28f540f4
RM
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
41bdb6e2 12# Lesser General Public License for more details.
28f540f4 13
41bdb6e2 14# You should have received a copy of the GNU Lesser General Public
59ba27a6
PE
15# License along with the GNU C Library; if not, see
16# <http://www.gnu.org/licenses/>.
28f540f4
RM
17
18#
19# Makefile for locales.
20#
21subdir := locale
22
a5f891ac
JM
23include ../Makeconfig
24
3e154a6f 25headers = locale.h bits/locale.h langinfo.h xlocale.h
cb09a2cd
RM
26routines = setlocale findlocale loadlocale loadarchive \
27 localeconv nl_langinfo nl_langinfo_l mb_cur_max \
30c14c31 28 newlocale duplocale freelocale uselocale
74432447 29tests = tst-C-locale tst-locname tst-duplocale
4b10dd6c
UD
30categories = ctype messages monetary numeric time paper name \
31 address telephone measurement identification collate
5db91571 32aux = $(categories:%=lc-%) $(categories:%=C-%) SYS_libc C_name \
25337753 33 xlocale localename global-locale coll-lookup
cd33623e 34others = localedef locale
70e51ab9 35#others-static = localedef locale
299a95b9 36install-bin = localedef locale
9649be24
UD
37extra-objs = $(localedef-modules:=.o) $(localedef-aux:=.o) \
38 $(locale-modules:=.o) $(lib-modules:=.o)
2b83a2a4 39
6259ec0d
UD
40extra-libs = libBrokenLocale
41extra-libs-others = $(extra-libs)
42
43libBrokenLocale-routines = broken_cur_max
44
df7c0d23 45subdir-dirs = programs
a7b65cdc 46vpath %.c programs ../crypt
19bc17a9 47vpath %.h programs
f127cd28 48vpath %.gperf programs
19bc17a9 49
675456ef
RM
50localedef-modules := localedef $(categories:%=ld-%) \
51 charmap linereader locfile \
934b77ac
UD
52 repertoire locarchive
53localedef-aux := md5
675456ef 54locale-modules := locale locale-spec
3e076219 55lib-modules := charmap-dir simple-hash xmalloc xstrdup
2b83a2a4
RM
56
57
58GPERF = gperf
4b10dd6c 59GPERFFLAGS = -acCgopt -k1,2,5,9,$$ -L ANSI-C
28f540f4
RM
60
61include ../Rules
2b83a2a4 62
3a0d900a
DM
63CFLAGS-md5.c = -I../crypt
64
19bc17a9 65programs/%-kw.h: programs/%-kw.gperf
00c2b3b9
UD
66 cd programs \
67 && $(GPERF) $(GPERFFLAGS) -N $(@F:-kw.h=_hash) $(<F) > $(@F).new
2b83a2a4
RM
68 mv -f $@.new $@
69
70$(objpfx)localedef: $(localedef-modules:%=$(objpfx)%.o)
934b77ac 71$(objpfx)localedef: $(localedef-aux:%=$(objpfx)%.o)
2b83a2a4
RM
72$(objpfx)locale: $(locale-modules:%=$(objpfx)%.o)
73$(objpfx)localedef $(objpfx)locale: $(lib-modules:%=$(objpfx)%.o)
74
04fbc779
UD
75C-translit.h: C-translit.h.in gen-translit.pl
76 $(PERL) gen-translit.pl < $< > $@.tmp
69c69fe1 77 mv -f $@.tmp $@
04fbc779 78
47707456 79localepath = "$(localedir):$(i18ndir)"
e4cf5070 80
675456ef
RM
81# -Iprograms doesn't really belong here, but this gets it at the head
82# of the list instead of the tail, where CPPFLAGS-$(lib) gets added.
83# We need it before the standard -I's to see programs/config.h first.
84locale-CPPFLAGS = -DLOCALEDIR='"$(localedir)"' \
85 -DLOCALE_ALIAS_PATH='"$(msgcatdir)"' \
86 -Iprograms
87
88CPPFLAGS-locale-programs = -DLOCALE_PATH='$(localepath)' \
89 -DCHARMAP_PATH='"$(i18ndir)/charmaps"' \
90 -DREPERTOIREMAP_PATH='"$(i18ndir)/repertoiremaps"' \
91 -DLOCSRCDIR='"$(i18ndir)/locales"' \
26ffd5e6 92 -DNOT_IN_libc
0793d348 93
6973fc01
UD
94CFLAGS-charmap.c = -Wno-write-strings -Wno-char-subscripts
95CFLAGS-locfile.c = -Wno-write-strings -Wno-char-subscripts
3e076219 96CFLAGS-charmap-dir.c = -Wno-write-strings
6259ec0d 97
675456ef 98# This makes sure -DNOT_IN_libc et al are passed for all these modules.
0f283ffc 99cpp-srcs-left := $(addsuffix .c,$(localedef-modules) $(localedef-aux) \
4fb9241e 100 $(locale-modules) $(lib-modules))
675456ef 101lib := locale-programs
0f283ffc 102include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))