]> git.ipfire.org Git - thirdparty/glibc.git/blob - locale/Makefile
nptl: Move pthread_attr_setinheritsched implementation into libc.
[thirdparty/glibc.git] / locale / Makefile
1 # Copyright (C) 1991-2019 Free Software Foundation, Inc.
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
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.
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
12 # Lesser General Public License for more details.
13
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/>.
17
18 #
19 # Makefile for locales.
20 #
21 subdir := locale
22
23 include ../Makeconfig
24
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 categories = ctype messages monetary numeric time paper name \
32 address telephone measurement identification collate
33 aux = $(categories:%=lc-%) $(categories:%=C-%) SYS_libc C_name \
34 xlocale localename global-locale coll-lookup
35 others = localedef locale
36 #others-static = localedef locale
37 install-bin = localedef locale
38 extra-objs = $(localedef-modules:=.o) $(localedef-aux:=.o) \
39 $(locale-modules:=.o) $(lib-modules:=.o)
40 generated += C-translit.h
41 before-compile += $(objpfx)C-translit.h
42
43 extra-libs = libBrokenLocale
44 extra-libs-others = $(extra-libs)
45
46 libBrokenLocale-routines = broken_cur_max
47
48 subdir-dirs = programs
49 vpath %.c programs ../crypt
50 vpath %.h programs
51 vpath %.gperf programs
52
53 localedef-modules := localedef $(categories:%=ld-%) \
54 charmap linereader locfile \
55 repertoire locarchive
56 localedef-aux := md5
57 locale-modules := locale locale-spec
58 lib-modules := charmap-dir simple-hash xmalloc xstrdup \
59 record-status
60
61
62 GPERF = gperf
63 GPERFFLAGS = -acCgopt -k1,2,5,9,$$ -L ANSI-C
64
65 ifeq ($(run-built-tests),yes)
66 tests-special += $(objpfx)tst-locale-locpath.out
67 endif
68
69 include ../Rules
70
71 CFLAGS-md5.c += -I../crypt
72
73 programs/%-kw.h: programs/%-kw.gperf
74 cd programs \
75 && $(GPERF) $(GPERFFLAGS) -N $(@F:-kw.h=_hash) $(<F) > $(@F).new
76 mv -f $@.new $@
77
78 $(objpfx)localedef: $(localedef-modules:%=$(objpfx)%.o)
79 $(objpfx)localedef: $(localedef-aux:%=$(objpfx)%.o)
80 $(objpfx)locale: $(locale-modules:%=$(objpfx)%.o)
81 $(objpfx)localedef $(objpfx)locale: $(lib-modules:%=$(objpfx)%.o)
82
83 $(objpfx)C-translit.h: C-translit.h.in gen-translit.py
84 $(make-target-directory)
85 $(PYTHON) gen-translit.py < $< > $@.tmp
86 mv -f $@.tmp $@
87
88 # The path to the compiled binary locale archive or compiled locales,
89 # along with the parent path to the source locales and source
90 # charmaps.
91 localepath = "$(complocaledir):$(i18ndir)"
92
93 # -Iprograms doesn't really belong here, but this gets it at the head
94 # of the list instead of the tail, where CPPFLAGS-$(lib) gets added.
95 # We need it before the standard -I's to see programs/config.h first.
96 locale-CPPFLAGS = -DCOMPLOCALEDIR='"$(complocaledir)"' \
97 -DLOCALE_ALIAS_PATH='"$(localedir)"' \
98 -Iprograms
99
100 CPPFLAGS-locale-programs = -DLOCALE_PATH='$(localepath)' \
101 -DCHARMAP_PATH='"$(i18ndir)/charmaps"' \
102 -DREPERTOIREMAP_PATH='"$(i18ndir)/repertoiremaps"' \
103 -DLOCSRCDIR='"$(i18ndir)/locales"'
104
105 CFLAGS-charmap.c += -Wno-write-strings -Wno-char-subscripts
106 CFLAGS-locfile.c += -Wno-write-strings -Wno-char-subscripts
107 CFLAGS-charmap-dir.c += -Wno-write-strings
108
109 # Set libof-* for each routine.
110 cpp-srcs-left := $(localedef-modules) $(localedef-aux) $(locale-modules) \
111 $(lib-modules)
112 lib := locale-programs
113 include $(patsubst %,$(..)libof-iterator.mk,$(cpp-srcs-left))
114
115 $(objpfx)tst-locale-locpath.out : tst-locale-locpath.sh $(objpfx)locale
116 $(SHELL) $< '$(common-objpfx)' '$(test-wrapper-env)' '$(run-program-env)' > $@; \
117 $(evaluate-test)