lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame^] | 1 | # Copyright (C) 1991-2015 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 | # <http://www.gnu.org/licenses/>. |
| 17 | |
| 18 | # |
| 19 | # Makefile for locales. |
| 20 | # |
| 21 | subdir := locale |
| 22 | |
| 23 | include ../Makeconfig |
| 24 | |
| 25 | headers = locale.h bits/locale.h langinfo.h xlocale.h |
| 26 | routines = setlocale findlocale loadlocale loadarchive \ |
| 27 | localeconv nl_langinfo nl_langinfo_l mb_cur_max \ |
| 28 | newlocale duplocale freelocale uselocale |
| 29 | tests = tst-C-locale tst-locname tst-duplocale |
| 30 | categories = ctype messages monetary numeric time paper name \ |
| 31 | address telephone measurement identification collate |
| 32 | aux = $(categories:%=lc-%) $(categories:%=C-%) SYS_libc C_name \ |
| 33 | xlocale localename global-locale coll-lookup |
| 34 | others = localedef locale |
| 35 | #others-static = localedef locale |
| 36 | install-bin = localedef locale |
| 37 | extra-objs = $(localedef-modules:=.o) $(localedef-aux:=.o) \ |
| 38 | $(locale-modules:=.o) $(lib-modules:=.o) |
| 39 | |
| 40 | extra-libs = libBrokenLocale |
| 41 | extra-libs-others = $(extra-libs) |
| 42 | |
| 43 | libBrokenLocale-routines = broken_cur_max |
| 44 | |
| 45 | subdir-dirs = programs |
| 46 | vpath %.c programs ../crypt |
| 47 | vpath %.h programs |
| 48 | vpath %.gperf programs |
| 49 | |
| 50 | localedef-modules := localedef $(categories:%=ld-%) \ |
| 51 | charmap linereader locfile \ |
| 52 | repertoire locarchive |
| 53 | localedef-aux := md5 |
| 54 | locale-modules := locale locale-spec |
| 55 | lib-modules := charmap-dir simple-hash xmalloc xstrdup |
| 56 | |
| 57 | |
| 58 | GPERF = gperf |
| 59 | GPERFFLAGS = -acCgopt -k1,2,5,9,$$ -L ANSI-C |
| 60 | |
| 61 | include ../Rules |
| 62 | |
| 63 | CFLAGS-md5.c = -I../crypt |
| 64 | |
| 65 | programs/%-kw.h: programs/%-kw.gperf |
| 66 | cd programs \ |
| 67 | && $(GPERF) $(GPERFFLAGS) -N $(@F:-kw.h=_hash) $(<F) > $(@F).new |
| 68 | mv -f $@.new $@ |
| 69 | |
| 70 | $(objpfx)localedef: $(localedef-modules:%=$(objpfx)%.o) |
| 71 | $(objpfx)localedef: $(localedef-aux:%=$(objpfx)%.o) |
| 72 | $(objpfx)locale: $(locale-modules:%=$(objpfx)%.o) |
| 73 | $(objpfx)localedef $(objpfx)locale: $(lib-modules:%=$(objpfx)%.o) |
| 74 | |
| 75 | C-translit.h: C-translit.h.in gen-translit.pl |
| 76 | $(PERL) gen-translit.pl < $< > $@.tmp |
| 77 | mv -f $@.tmp $@ |
| 78 | |
| 79 | localepath = "$(localedir):$(i18ndir)" |
| 80 | |
| 81 | # -Iprograms doesn't really belong here, but this gets it at the head |
| 82 | # of the list instead of the tail, where CPPFLAGS-$(lib) gets added. |
| 83 | # We need it before the standard -I's to see programs/config.h first. |
| 84 | locale-CPPFLAGS = -DLOCALEDIR='"$(localedir)"' \ |
| 85 | -DLOCALE_ALIAS_PATH='"$(msgcatdir)"' \ |
| 86 | -Iprograms |
| 87 | |
| 88 | CPPFLAGS-locale-programs = -DLOCALE_PATH='$(localepath)' \ |
| 89 | -DCHARMAP_PATH='"$(i18ndir)/charmaps"' \ |
| 90 | -DREPERTOIREMAP_PATH='"$(i18ndir)/repertoiremaps"' \ |
| 91 | -DLOCSRCDIR='"$(i18ndir)/locales"' |
| 92 | |
| 93 | CFLAGS-charmap.c = -Wno-write-strings -Wno-char-subscripts |
| 94 | CFLAGS-locfile.c = -Wno-write-strings -Wno-char-subscripts |
| 95 | CFLAGS-charmap-dir.c = -Wno-write-strings |
| 96 | |
| 97 | # Set libof-* for each routine. |
| 98 | cpp-srcs-left := $(localedef-modules) $(localedef-aux) $(locale-modules) \ |
| 99 | $(lib-modules) |
| 100 | lib := locale-programs |
| 101 | include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left)) |