Files
glibc/catgets/Makefile
T

140 lines
3.9 KiB
Makefile
Raw Normal View History

# Copyright (C) 1996-2026 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# The GNU C Library is free software; you can redistribute it and/or
2001-07-06 04:58:11 +00:00
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
# The GNU C Library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2001-07-06 04:58:11 +00:00
# Lesser General Public License for more details.
2001-07-06 04:58:11 +00:00
# You should have received a copy of the GNU Lesser General Public
2012-02-09 23:18:22 +00:00
# License along with the GNU C Library; if not, see
# <https://www.gnu.org/licenses/>.
#
# Makefile for catgets.
#
subdir := catgets
include ../Makeconfig
2024-12-05 15:16:43 +08:00
headers = \
2023-05-18 13:13:32 -04:00
nl_types.h \
# headers
routines = \
catgets \
open_catalog \
# routines
others = gencat
install-bin = gencat
1997-09-16 00:42:43 +00:00
extra-objs = $(gencat-modules:=.o)
2000-09-07 03:49:56 +00:00
tests = tst-catgets
2000-11-28 13:57:45 +00:00
test-srcs = test-gencat
2000-09-07 03:49:56 +00:00
ifeq ($(run-built-tests),yes)
2023-05-18 13:13:32 -04:00
tests-special += \
$(objpfx)de/libc.cat \
$(objpfx)sample.SJIS.cat \
$(objpfx)test-gencat.out \
$(objpfx)test1.cat \
$(objpfx)test2.cat \
# tests-special
ifeq (yes,$(build-shared))
ifneq ($(PERL),no)
tests-special += $(objpfx)tst-catgets-mem.out
endif
endif
endif
gencat-modules = xmalloc
others-extras = $(gencat-modules)
# To find xmalloc.c
vpath %.c ../locale/programs
include ../Rules
# The catalog-generation tests below run gencat under specific locales,
# and tst-catgets reads the resulting catalog, so the build must wait for
# those locales to be generated. Without this dependency a parallel build
# races catgets against localedata and gencat can run before the locale
# exists (it then falls back to C and the test fails).
LOCALES := de_DE.ISO-8859-1 hr_HR.ISO-8859-2 ja_JP.SJIS
include ../gen-locales.mk
$(objpfx)gencat: $(gencat-modules:%=$(objpfx)%.o)
catgets-CPPFLAGS := -DNLSPATH='"$(localedir)/%L/%N:$(localedir)/%L/LC_MESSAGES/%N:$(localedir)/%l/%N:$(localedir)/%l/LC_MESSAGES/%N:"'
1998-05-22 11:02:04 +00:00
2023-05-18 13:13:32 -04:00
generated += \
de.msg \
sample.SJIS.cat \
test-gencat.h \
test1.cat \
test1.h \
test2.cat \
test2.h \
# generated
ifeq ($(run-built-tests),yes)
ifeq (yes,$(build-shared))
ifneq ($(PERL),no)
generated += \
2023-05-18 13:13:32 -04:00
tst-catgets-mem.out \
tst-catgets.mtrace \
# generated
endif
endif
endif
2015-08-08 15:53:03 -07:00
2023-05-18 13:13:32 -04:00
generated-dirs += \
de \
# generated-dirs
2000-09-07 03:49:56 +00:00
2021-07-22 18:37:59 +05:30
tst-catgets-ENV = NLSPATH="$(objpfx)%l/%N.cat" LANG=de \
MALLOC_TRACE=$(objpfx)tst-catgets.mtrace \
LD_PRELOAD=$(common-objpfx)/malloc/libc_malloc_debug.so
1998-05-22 11:02:04 +00:00
2012-10-24 00:08:46 +00:00
ifeq ($(run-built-tests),yes)
1998-05-22 11:02:04 +00:00
# This test just checks whether the program produces any error or not.
# The result is not tested.
$(objpfx)test1.cat: test1.msg $(objpfx)gencat $(gen-locales)
$(built-program-cmd-before-env) \
$(run-program-env) LC_ALL=hr_HR.ISO-8859-2 \
$(built-program-cmd-after-env) -H $(objpfx)test1.h $@ $<; \
$(evaluate-test)
2003-02-22 23:19:31 +00:00
$(objpfx)test2.cat: test2.msg $(objpfx)gencat
$(built-program-cmd) -H $(objpfx)test2.h $@ $<; \
$(evaluate-test)
$(objpfx)de/libc.cat: $(objpfx)de.msg $(objpfx)gencat $(gen-locales)
2000-09-18 00:43:17 +00:00
$(make-target-directory)
$(built-program-cmd-before-env) \
$(run-program-env) LC_ALL=de_DE.ISO-8859-1 \
$(built-program-cmd-after-env) $@ $<; \
$(evaluate-test)
2000-09-07 03:49:56 +00:00
$(objpfx)tst-catgets.out: $(objpfx)de/libc.cat
1998-05-22 11:02:04 +00:00
# Generate a non-simple input file.
2012-07-04 15:57:51 +02:00
$(objpfx)de.msg: xopen-msg.awk $(..)po/de.po
LC_ALL=C $(AWK) -f $^ $< > $@
2000-11-28 13:57:45 +00:00
$(objpfx)test-gencat.out: test-gencat.sh $(objpfx)test-gencat \
$(objpfx)sample.SJIS.cat $(gen-locales)
$(SHELL) $< $(common-objpfx) '$(test-program-cmd-before-env)' \
'$(run-program-env)' '$(test-program-cmd-after-env)'; \
$(evaluate-test)
2000-11-28 13:57:45 +00:00
$(objpfx)sample.SJIS.cat: sample.SJIS $(objpfx)gencat
$(built-program-cmd) -H $(objpfx)test-gencat.h < $(word 1,$^) > $@; \
$(evaluate-test)
2015-08-08 15:53:03 -07:00
$(objpfx)tst-catgets-mem.out: $(objpfx)tst-catgets.out
$(common-objpfx)malloc/mtrace $(objpfx)tst-catgets.mtrace > $@; \
$(evaluate-test)
1998-08-31 11:11:15 +00:00
endif