scratch_buffer_set_array_size: Include <limits.h>
[glibc.git] / locale / Makefile
blobc5379e626065e439d7a9b30dbe38a81cb48e607d
1 # Copyright (C) 1991-2016 Free Software Foundation, Inc.
2 # This file is part of the GNU C Library.
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.
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.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with the GNU C Library; if not, see
16 # <http://www.gnu.org/licenses/>.
19 # Makefile for locales.
21 subdir := locale
23 include ../Makeconfig
25 headers = locale.h bits/locale.h langinfo.h xlocale.h
26 routines = setlocale findlocale loadlocale loadarchive \
27 localeconv nl_langinfo nl_langinfo_l mb_cur_max \
28 newlocale duplocale freelocale uselocale
29 tests = tst-C-locale tst-locname tst-duplocale
30 categories = ctype messages monetary numeric time paper name \
31 address telephone measurement identification collate
32 aux = $(categories:%=lc-%) $(categories:%=C-%) SYS_libc C_name \
33 xlocale localename global-locale coll-lookup
34 others = localedef locale
35 #others-static = localedef locale
36 install-bin = localedef locale
37 extra-objs = $(localedef-modules:=.o) $(localedef-aux:=.o) \
38 $(locale-modules:=.o) $(lib-modules:=.o)
40 extra-libs = libBrokenLocale
41 extra-libs-others = $(extra-libs)
43 libBrokenLocale-routines = broken_cur_max
45 subdir-dirs = programs
46 vpath %.c programs ../crypt
47 vpath %.h programs
48 vpath %.gperf programs
50 localedef-modules := localedef $(categories:%=ld-%) \
51 charmap linereader locfile \
52 repertoire locarchive
53 localedef-aux := md5
54 locale-modules := locale locale-spec
55 lib-modules := charmap-dir simple-hash xmalloc xstrdup
58 GPERF = gperf
59 GPERFFLAGS = -acCgopt -k1,2,5,9,$$ -L ANSI-C
61 include ../Rules
63 CFLAGS-md5.c = -I../crypt
65 programs/%-kw.h: programs/%-kw.gperf
66 cd programs \
67 && $(GPERF) $(GPERFFLAGS) -N $(@F:-kw.h=_hash) $(<F) > $(@F).new
68 mv -f $@.new $@
70 $(objpfx)localedef: $(localedef-modules:%=$(objpfx)%.o)
71 $(objpfx)localedef: $(localedef-aux:%=$(objpfx)%.o)
72 $(objpfx)locale: $(locale-modules:%=$(objpfx)%.o)
73 $(objpfx)localedef $(objpfx)locale: $(lib-modules:%=$(objpfx)%.o)
75 C-translit.h: C-translit.h.in gen-translit.pl
76 $(PERL) gen-translit.pl < $< > $@.tmp
77 mv -f $@.tmp $@
79 # The path to the compiled binary locale archive or compiled locales,
80 # along with the parent path to the source locales and source
81 # charmaps.
82 localepath = "$(complocaledir):$(i18ndir)"
84 # -Iprograms doesn't really belong here, but this gets it at the head
85 # of the list instead of the tail, where CPPFLAGS-$(lib) gets added.
86 # We need it before the standard -I's to see programs/config.h first.
87 locale-CPPFLAGS = -DCOMPLOCALEDIR='"$(complocaledir)"' \
88 -DLOCALE_ALIAS_PATH='"$(localedir)"' \
89 -Iprograms
91 CPPFLAGS-locale-programs = -DLOCALE_PATH='$(localepath)' \
92 -DCHARMAP_PATH='"$(i18ndir)/charmaps"' \
93 -DREPERTOIREMAP_PATH='"$(i18ndir)/repertoiremaps"' \
94 -DLOCSRCDIR='"$(i18ndir)/locales"'
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
100 # Set libof-* for each routine.
101 cpp-srcs-left := $(localedef-modules) $(localedef-aux) $(locale-modules) \
102 $(lib-modules)
103 lib := locale-programs
104 include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))