]> git.ipfire.org Git - thirdparty/glibc.git/blame - locale/Makefile
Update copyright dates with scripts/update-copyrights
[thirdparty/glibc.git] / locale / Makefile
CommitLineData
dff8da6b 1# Copyright (C) 1991-2024 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 15# License along with the GNU C Library; if not, see
5a82c748 16# <https://www.gnu.org/licenses/>.
28f540f4
RM
17
18#
19# Makefile for locales.
20#
21subdir := locale
22
a5f891ac
JM
23include ../Makeconfig
24
f0be25b6
ZW
25headers = langinfo.h locale.h bits/locale.h \
26 bits/types/locale_t.h bits/types/__locale_t.h
cb09a2cd
RM
27routines = setlocale findlocale loadlocale loadarchive \
28 localeconv nl_langinfo nl_langinfo_l mb_cur_max \
30c14c31 29 newlocale duplocale freelocale uselocale
74432447 30tests = tst-C-locale tst-locname tst-duplocale
92954ffa 31tests-container = tst-localedef-path-norm
4b10dd6c
UD
32categories = ctype messages monetary numeric time paper name \
33 address telephone measurement identification collate
5db91571 34aux = $(categories:%=lc-%) $(categories:%=C-%) SYS_libc C_name \
25337753 35 xlocale localename global-locale coll-lookup
cd33623e 36others = localedef locale
70e51ab9 37#others-static = localedef locale
299a95b9 38install-bin = localedef locale
9649be24
UD
39extra-objs = $(localedef-modules:=.o) $(localedef-aux:=.o) \
40 $(locale-modules:=.o) $(lib-modules:=.o)
053c52b1
FW
41generated += C-translit.h
42before-compile += $(objpfx)C-translit.h
2b83a2a4 43
6259ec0d
UD
44extra-libs = libBrokenLocale
45extra-libs-others = $(extra-libs)
46
47libBrokenLocale-routines = broken_cur_max
48
df7c0d23 49subdir-dirs = programs
e6e3c666 50vpath %.c programs
19bc17a9 51vpath %.h programs
f127cd28 52vpath %.gperf programs
19bc17a9 53
675456ef
RM
54localedef-modules := localedef $(categories:%=ld-%) \
55 charmap linereader locfile \
934b77ac
UD
56 repertoire locarchive
57localedef-aux := md5
675456ef 58locale-modules := locale locale-spec
02eec681 59lib-modules := charmap-dir simple-hash xmalloc xstrdup \
92954ffa 60 record-status xasprintf
2b83a2a4
RM
61
62
63GPERF = gperf
4b10dd6c 64GPERFFLAGS = -acCgopt -k1,2,5,9,$$ -L ANSI-C
28f540f4 65
439bf534
FW
66ifeq ($(run-built-tests),yes)
67tests-special += $(objpfx)tst-locale-locpath.out
68endif
69
28f540f4 70include ../Rules
2b83a2a4 71
19bc17a9 72programs/%-kw.h: programs/%-kw.gperf
00c2b3b9
UD
73 cd programs \
74 && $(GPERF) $(GPERFFLAGS) -N $(@F:-kw.h=_hash) $(<F) > $(@F).new
2b83a2a4
RM
75 mv -f $@.new $@
76
77$(objpfx)localedef: $(localedef-modules:%=$(objpfx)%.o)
934b77ac 78$(objpfx)localedef: $(localedef-aux:%=$(objpfx)%.o)
2b83a2a4
RM
79$(objpfx)locale: $(locale-modules:%=$(objpfx)%.o)
80$(objpfx)localedef $(objpfx)locale: $(lib-modules:%=$(objpfx)%.o)
81
053c52b1
FW
82$(objpfx)C-translit.h: C-translit.h.in gen-translit.py
83 $(make-target-directory)
84 $(PYTHON) gen-translit.py < $< > $@.tmp
69c69fe1 85 mv -f $@.tmp $@
04fbc779 86
90fe682d
CD
87# The path to the compiled binary locale archive or compiled locales,
88# along with the parent path to the source locales and source
89# charmaps.
90localepath = "$(complocaledir):$(i18ndir)"
e4cf5070 91
675456ef
RM
92# -Iprograms doesn't really belong here, but this gets it at the head
93# of the list instead of the tail, where CPPFLAGS-$(lib) gets added.
94# We need it before the standard -I's to see programs/config.h first.
90fe682d 95locale-CPPFLAGS = -DCOMPLOCALEDIR='"$(complocaledir)"' \
314f6dee 96 -DLOCALE_ALIAS_PATH='"$(localedir)"' \
675456ef
RM
97 -Iprograms
98
99CPPFLAGS-locale-programs = -DLOCALE_PATH='$(localepath)' \
100 -DCHARMAP_PATH='"$(i18ndir)/charmaps"' \
101 -DREPERTOIREMAP_PATH='"$(i18ndir)/repertoiremaps"' \
4f41c682 102 -DLOCSRCDIR='"$(i18ndir)/locales"'
0793d348 103
36975e8e
L
104CFLAGS-charmap.c += -Wno-write-strings -Wno-char-subscripts
105CFLAGS-locfile.c += -Wno-write-strings -Wno-char-subscripts
106CFLAGS-charmap-dir.c += -Wno-write-strings
6259ec0d 107
4f41c682 108# Set libof-* for each routine.
9cd47470
SP
109cpp-srcs-left := $(localedef-modules) $(localedef-aux) $(locale-modules) \
110 $(lib-modules)
675456ef 111lib := locale-programs
2bfdaedd 112include $(patsubst %,$(..)libof-iterator.mk,$(cpp-srcs-left))
e485b2b6
FW
113
114$(objpfx)tst-locale-locpath.out : tst-locale-locpath.sh $(objpfx)locale
7901d4ee 115 $(SHELL) $< '$(common-objpfx)' '$(test-wrapper-env)' '$(run-program-env)' > $@; \
e485b2b6 116 $(evaluate-test)
6c4ed247
AZ
117
118$(objpfx)tst-localedef-path-norm: $(shared-thread-library)