Blame locale/Makefile

Packit Service 82fcde
# Copyright (C) 1991-2018 Free Software Foundation, Inc.
Packit Service 82fcde
# This file is part of the GNU C Library.
Packit Service 82fcde
Packit Service 82fcde
# The GNU C Library is free software; you can redistribute it and/or
Packit Service 82fcde
# modify it under the terms of the GNU Lesser General Public
Packit Service 82fcde
# License as published by the Free Software Foundation; either
Packit Service 82fcde
# version 2.1 of the License, or (at your option) any later version.
Packit Service 82fcde
Packit Service 82fcde
# The GNU C Library is distributed in the hope that it will be useful,
Packit Service 82fcde
# but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 82fcde
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service 82fcde
# Lesser General Public License for more details.
Packit Service 82fcde
Packit Service 82fcde
# You should have received a copy of the GNU Lesser General Public
Packit Service 82fcde
# License along with the GNU C Library; if not, see
Packit Service 82fcde
# <http://www.gnu.org/licenses/>.
Packit Service 82fcde
Packit Service 82fcde
#
Packit Service 82fcde
#	Makefile for locales.
Packit Service 82fcde
#
Packit Service 82fcde
subdir	:= locale
Packit Service 82fcde
Packit Service 82fcde
include ../Makeconfig
Packit Service 82fcde
Packit Service 82fcde
headers		= langinfo.h locale.h bits/locale.h \
Packit Service 82fcde
		  bits/types/locale_t.h bits/types/__locale_t.h
Packit Service 82fcde
routines	= setlocale findlocale loadlocale loadarchive \
Packit Service 82fcde
		  localeconv nl_langinfo nl_langinfo_l mb_cur_max \
Packit Service 82fcde
		  newlocale duplocale freelocale uselocale
Packit Service 82fcde
tests		= tst-C-locale tst-locname tst-duplocale
Packit Service 82fcde
categories	= ctype messages monetary numeric time paper name \
Packit Service 82fcde
		  address telephone measurement identification collate
Packit Service 82fcde
aux		= $(categories:%=lc-%) $(categories:%=C-%) SYS_libc C_name \
Packit Service 82fcde
		  xlocale localename global-locale coll-lookup
Packit Service 82fcde
others		= localedef locale
Packit Service 82fcde
#others-static	= localedef locale
Packit Service 82fcde
install-bin	= localedef locale
Packit Service 82fcde
extra-objs	= $(localedef-modules:=.o) $(localedef-aux:=.o) \
Packit Service 82fcde
		  $(locale-modules:=.o) $(lib-modules:=.o)
Packit Service 82fcde
Packit Service 82fcde
extra-libs	= libBrokenLocale
Packit Service 82fcde
extra-libs-others = $(extra-libs)
Packit Service 82fcde
Packit Service 82fcde
libBrokenLocale-routines = broken_cur_max
Packit Service 82fcde
Packit Service 82fcde
subdir-dirs	= programs
Packit Service 82fcde
vpath %.c programs ../crypt
Packit Service 82fcde
vpath %.h programs
Packit Service 82fcde
vpath %.gperf programs
Packit Service 82fcde
Packit Service 82fcde
localedef-modules	:= localedef $(categories:%=ld-%) \
Packit Service 82fcde
			   charmap linereader locfile \
Packit Service 82fcde
			   repertoire locarchive
Packit Service 82fcde
localedef-aux		:= md5
Packit Service 82fcde
locale-modules		:= locale locale-spec
Packit Service 82fcde
lib-modules		:= charmap-dir simple-hash xmalloc xstrdup \
Packit Service 82fcde
			   record-status
Packit Service 82fcde
Packit Service 82fcde
Packit Service 82fcde
GPERF = gperf
Packit Service 82fcde
GPERFFLAGS = -acCgopt -k1,2,5,9,$$ -L ANSI-C
Packit Service 82fcde
Packit Service eddcf6
ifeq ($(run-built-tests),yes)
Packit Service eddcf6
tests-special += $(objpfx)tst-locale-locpath.out
Packit Service eddcf6
endif
Packit Service eddcf6
Packit Service 82fcde
include ../Rules
Packit Service 82fcde
Packit Service 82fcde
CFLAGS-md5.c += -I../crypt
Packit Service 82fcde
Packit Service 82fcde
programs/%-kw.h: programs/%-kw.gperf
Packit Service 82fcde
	cd programs \
Packit Service 82fcde
	&& $(GPERF) $(GPERFFLAGS) -N $(@F:-kw.h=_hash) $(<F) > $(@F).new
Packit Service 82fcde
	mv -f $@.new $@
Packit Service 82fcde
Packit Service 82fcde
$(objpfx)localedef: $(localedef-modules:%=$(objpfx)%.o)
Packit Service 82fcde
$(objpfx)localedef: $(localedef-aux:%=$(objpfx)%.o)
Packit Service 82fcde
$(objpfx)locale: $(locale-modules:%=$(objpfx)%.o)
Packit Service 82fcde
$(objpfx)localedef $(objpfx)locale: $(lib-modules:%=$(objpfx)%.o)
Packit Service 82fcde
Packit Service 82fcde
C-translit.h: C-translit.h.in gen-translit.pl
Packit Service 82fcde
	$(PERL) gen-translit.pl < $< > $@.tmp
Packit Service 82fcde
	mv -f $@.tmp $@
Packit Service 82fcde
Packit Service 82fcde
# The path to the compiled binary locale archive or compiled locales,
Packit Service 82fcde
# along with the parent path to the source locales and source
Packit Service 82fcde
# charmaps.
Packit Service 82fcde
localepath = "$(complocaledir):$(i18ndir)"
Packit Service 82fcde
Packit Service 82fcde
# -Iprograms doesn't really belong here, but this gets it at the head
Packit Service 82fcde
# of the list instead of the tail, where CPPFLAGS-$(lib) gets added.
Packit Service 82fcde
# We need it before the standard -I's to see programs/config.h first.
Packit Service 82fcde
locale-CPPFLAGS = -DCOMPLOCALEDIR='"$(complocaledir)"' \
Packit Service 82fcde
		  -DLOCALE_ALIAS_PATH='"$(localedir)"' \
Packit Service 82fcde
		  -Iprograms
Packit Service 82fcde
Packit Service 82fcde
CPPFLAGS-locale-programs = -DLOCALE_PATH='$(localepath)' \
Packit Service 82fcde
			   -DCHARMAP_PATH='"$(i18ndir)/charmaps"' \
Packit Service 82fcde
			   -DREPERTOIREMAP_PATH='"$(i18ndir)/repertoiremaps"' \
Packit Service 82fcde
			   -DLOCSRCDIR='"$(i18ndir)/locales"'
Packit Service 82fcde
Packit Service 82fcde
CFLAGS-charmap.c += -Wno-write-strings -Wno-char-subscripts
Packit Service 82fcde
CFLAGS-locfile.c += -Wno-write-strings -Wno-char-subscripts
Packit Service 82fcde
CFLAGS-charmap-dir.c += -Wno-write-strings
Packit Service 82fcde
Packit Service 82fcde
# Set libof-* for each routine.
Packit Service 82fcde
cpp-srcs-left := $(localedef-modules) $(localedef-aux) $(locale-modules) \
Packit Service 82fcde
		 $(lib-modules)
Packit Service 82fcde
lib := locale-programs
Packit Service 82fcde
include $(patsubst %,$(..)libof-iterator.mk,$(cpp-srcs-left))
Packit Service 2aef5f
Packit Service 2aef5f
$(objpfx)tst-locale-locpath.out : tst-locale-locpath.sh $(objpfx)locale
Packit Service 2aef5f
	$(SHELL) $< '$(common-objpfx)' '$(test-wrapper)' '$(test-wrapper-env)' > $@; \
Packit Service 2aef5f
	$(evaluate-test)