x86: Don't check XFD against /proc/cpuinfo
[glibc.git] / locale / Makefile
blob2810f286059954f487d7fa1241ffeebb5884efa7
1 # Copyright (C) 1991-2024 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 # <https://www.gnu.org/licenses/>.
19 # Makefile for locales.
21 subdir := locale
23 include ../Makeconfig
25 headers = \
26 bits/locale.h \
27 bits/types/__locale_t.h \
28 bits/types/locale_t.h \
29 langinfo.h \
30 locale.h \
31 # headers
32 routines = \
33 duplocale \
34 findlocale \
35 freelocale \
36 loadarchive \
37 loadlocale \
38 localeconv \
39 mb_cur_max \
40 newlocale \
41 nl_langinfo \
42 nl_langinfo_l \
43 setlocale \
44 uselocale
45 # routines
46 tests = \
47 tst-C-locale \
48 tst-duplocale \
49 tst-locname \
50 # tests
51 tests-container = \
52 tst-localedef-path-norm \
53 # tests-container
54 categories = \
55 address \
56 collate \
57 ctype \
58 identification \
59 measurement \
60 messages \
61 monetary \
62 name \
63 numeric \
64 paper \
65 telephone \
66 time \
67 # categories
68 aux = \
69 $(categories:%=C-%) \
70 $(categories:%=lc-%) \
71 C_name \
72 SYS_libc \
73 coll-lookup \
74 global-locale \
75 localename \
76 xlocale \
77 # aux
78 others = \
79 locale \
80 localedef \
81 # others
82 #others-static = \
83 # localedef \
84 # locale \
85 # # others-static
86 install-bin = \
87 locale \
88 localedef \
89 # install-bin
90 extra-objs = \
91 $(lib-modules:=.o) \
92 $(locale-modules:=.o) \
93 $(localedef-aux:=.o) \
94 $(localedef-modules:=.o) \
95 # extra-objs
96 generated += C-translit.h
97 before-compile += $(objpfx)C-translit.h
99 extra-libs = libBrokenLocale
100 extra-libs-others = $(extra-libs)
102 libBrokenLocale-routines = broken_cur_max
104 subdir-dirs = programs
105 vpath %.c programs
106 vpath %.h programs
107 vpath %.gperf programs
109 localedef-modules := \
110 charmap \
111 linereader \
112 localedef $(categories:%=ld-%) \
113 locarchive \
114 locfile \
115 repertoire \
116 # localedef-modules
117 localedef-aux := md5
118 locale-modules := \
119 locale \
120 locale-spec \
121 # locale-modules
122 lib-modules := \
123 charmap-dir \
124 record-status \
125 simple-hash \
126 xasprintf \
127 xmalloc \
128 xstrdup \
129 # lib-modules
131 GPERF = gperf
132 GPERFFLAGS = -acCgopt -k1,2,5,9,$$ -L ANSI-C
134 ifeq ($(run-built-tests),yes)
135 tests-special += $(objpfx)tst-locale-locpath.out
136 endif
138 include ../Rules
140 programs/%-kw.h: programs/%-kw.gperf
141 cd programs \
142 && $(GPERF) $(GPERFFLAGS) -N $(@F:-kw.h=_hash) $(<F) > $(@F).new
143 mv -f $@.new $@
145 $(objpfx)localedef: $(localedef-modules:%=$(objpfx)%.o)
146 $(objpfx)localedef: $(localedef-aux:%=$(objpfx)%.o)
147 $(objpfx)locale: $(locale-modules:%=$(objpfx)%.o)
148 $(objpfx)localedef $(objpfx)locale: $(lib-modules:%=$(objpfx)%.o)
150 $(objpfx)C-translit.h: C-translit.h.in gen-translit.py
151 $(make-target-directory)
152 $(PYTHON) gen-translit.py < $< > $@.tmp
153 mv -f $@.tmp $@
155 # The path to the compiled binary locale archive or compiled locales,
156 # along with the parent path to the source locales and source
157 # charmaps.
158 localepath = "$(complocaledir):$(i18ndir)"
160 # -Iprograms doesn't really belong here, but this gets it at the head
161 # of the list instead of the tail, where CPPFLAGS-$(lib) gets added.
162 # We need it before the standard -I's to see programs/config.h first.
163 locale-CPPFLAGS = -DCOMPLOCALEDIR='"$(complocaledir)"' \
164 -DLOCALE_ALIAS_PATH='"$(localedir)"' \
165 -Iprograms
167 CPPFLAGS-locale-programs = -DLOCALE_PATH='$(localepath)' \
168 -DCHARMAP_PATH='"$(i18ndir)/charmaps"' \
169 -DREPERTOIREMAP_PATH='"$(i18ndir)/repertoiremaps"' \
170 -DLOCSRCDIR='"$(i18ndir)/locales"'
172 CFLAGS-charmap.c += -Wno-write-strings -Wno-char-subscripts
173 CFLAGS-locfile.c += -Wno-write-strings -Wno-char-subscripts
174 CFLAGS-charmap-dir.c += -Wno-write-strings
176 # Set libof-* for each routine.
177 cpp-srcs-left := $(localedef-modules) $(localedef-aux) $(locale-modules) \
178 $(lib-modules)
179 lib := locale-programs
180 include $(patsubst %,$(..)libof-iterator.mk,$(cpp-srcs-left))
182 $(objpfx)tst-locale-locpath.out : tst-locale-locpath.sh $(objpfx)locale
183 $(SHELL) $< '$(common-objpfx)' '$(test-wrapper-env)' '$(run-program-env)' > $@; \
184 $(evaluate-test)
186 $(objpfx)tst-localedef-path-norm: $(shared-thread-library)