Blame locale/Makefile

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