linux: Add HWCAP2_HBC from Linux 6.6 to AArch64 bits/hwcap.h
[glibc.git] / locale / Makefile
blobc5387a35f33bb144027de155c2f4ab125d1a0e76
1 # Copyright (C) 1991-2023 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 = langinfo.h locale.h bits/locale.h \
26 bits/types/locale_t.h bits/types/__locale_t.h
27 routines = setlocale findlocale loadlocale loadarchive \
28 localeconv nl_langinfo nl_langinfo_l mb_cur_max \
29 newlocale duplocale freelocale uselocale
30 tests = tst-C-locale tst-locname tst-duplocale
31 tests-container = tst-localedef-path-norm
32 categories = ctype messages monetary numeric time paper name \
33 address telephone measurement identification collate
34 aux = $(categories:%=lc-%) $(categories:%=C-%) SYS_libc C_name \
35 xlocale localename global-locale coll-lookup
36 others = localedef locale
37 #others-static = localedef locale
38 install-bin = localedef locale
39 extra-objs = $(localedef-modules:=.o) $(localedef-aux:=.o) \
40 $(locale-modules:=.o) $(lib-modules:=.o)
41 generated += C-translit.h
42 before-compile += $(objpfx)C-translit.h
44 extra-libs = libBrokenLocale
45 extra-libs-others = $(extra-libs)
47 libBrokenLocale-routines = broken_cur_max
49 subdir-dirs = programs
50 vpath %.c programs
51 vpath %.h programs
52 vpath %.gperf programs
54 localedef-modules := localedef $(categories:%=ld-%) \
55 charmap linereader locfile \
56 repertoire locarchive
57 localedef-aux := md5
58 locale-modules := locale locale-spec
59 lib-modules := charmap-dir simple-hash xmalloc xstrdup \
60 record-status xasprintf
63 GPERF = gperf
64 GPERFFLAGS = -acCgopt -k1,2,5,9,$$ -L ANSI-C
66 ifeq ($(run-built-tests),yes)
67 tests-special += $(objpfx)tst-locale-locpath.out
68 endif
70 include ../Rules
72 programs/%-kw.h: programs/%-kw.gperf
73 cd programs \
74 && $(GPERF) $(GPERFFLAGS) -N $(@F:-kw.h=_hash) $(<F) > $(@F).new
75 mv -f $@.new $@
77 $(objpfx)localedef: $(localedef-modules:%=$(objpfx)%.o)
78 $(objpfx)localedef: $(localedef-aux:%=$(objpfx)%.o)
79 $(objpfx)locale: $(locale-modules:%=$(objpfx)%.o)
80 $(objpfx)localedef $(objpfx)locale: $(lib-modules:%=$(objpfx)%.o)
82 $(objpfx)C-translit.h: C-translit.h.in gen-translit.py
83 $(make-target-directory)
84 $(PYTHON) gen-translit.py < $< > $@.tmp
85 mv -f $@.tmp $@
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.
90 localepath = "$(complocaledir):$(i18ndir)"
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.
95 locale-CPPFLAGS = -DCOMPLOCALEDIR='"$(complocaledir)"' \
96 -DLOCALE_ALIAS_PATH='"$(localedir)"' \
97 -Iprograms
99 CPPFLAGS-locale-programs = -DLOCALE_PATH='$(localepath)' \
100 -DCHARMAP_PATH='"$(i18ndir)/charmaps"' \
101 -DREPERTOIREMAP_PATH='"$(i18ndir)/repertoiremaps"' \
102 -DLOCSRCDIR='"$(i18ndir)/locales"'
104 CFLAGS-charmap.c += -Wno-write-strings -Wno-char-subscripts
105 CFLAGS-locfile.c += -Wno-write-strings -Wno-char-subscripts
106 CFLAGS-charmap-dir.c += -Wno-write-strings
108 # Set libof-* for each routine.
109 cpp-srcs-left := $(localedef-modules) $(localedef-aux) $(locale-modules) \
110 $(lib-modules)
111 lib := locale-programs
112 include $(patsubst %,$(..)libof-iterator.mk,$(cpp-srcs-left))
114 $(objpfx)tst-locale-locpath.out : tst-locale-locpath.sh $(objpfx)locale
115 $(SHELL) $< '$(common-objpfx)' '$(test-wrapper-env)' '$(run-program-env)' > $@; \
116 $(evaluate-test)
118 $(objpfx)tst-localedef-path-norm: $(shared-thread-library)