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.
27 bits
/types
/__locale_t.h \
28 bits
/types
/locale_t.h \
52 tst-localedef-path-norm \
70 $(categories
:%=lc-
%) \
92 $(locale-modules
:=.o
) \
93 $(localedef-aux
:=.o
) \
94 $(localedef-modules
:=.o
) \
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
107 vpath
%.gperf programs
109 localedef-modules
:= \
112 localedef
$(categories
:%=ld-
%) \
132 GPERFFLAGS
= -acCgopt
-k1
,2,5,9,$$ -L ANSI-C
134 ifeq ($(run-built-tests
),yes
)
135 tests-special
+= $(objpfx
)tst-locale-locpath.out
140 programs
/%-kw.h
: programs
/%-kw.gperf
142 && $(GPERF
) $(GPERFFLAGS
) -N
$(@F
:-kw.h
=_hash
) $(<F
) > $(@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
155 # The path to the compiled binary locale archive or compiled locales,
156 # along with the parent path to the source locales and source
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)"' \
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
) \
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)' > $@
; \
186 $(objpfx
)tst-localedef-path-norm
: $(shared-thread-library
)