1 # Copyright (C) 1996-2023 Free Software Foundation, Inc.
2 # This file is part of the GNU C Library.
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.
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.
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/>.
19 # Makefile for catgets.
34 extra-objs
= $(gencat-modules
:=.o
)
37 test-srcs
= test-gencat
39 ifeq ($(run-built-tests
),yes
)
41 $(objpfx
)de
/libc.cat \
42 $(objpfx
)sample.SJIS.cat \
43 $(objpfx
)test-gencat.out \
46 $(objpfx
)tst-catgets-mem.out
50 gencat-modules
= xmalloc
51 others-extras
= $(gencat-modules
)
54 vpath
%.c ..
/locale
/programs
59 $(objpfx
)gencat
: $(gencat-modules
:%=$(objpfx
)%.o
)
61 catgets-CPPFLAGS
:= -DNLSPATH
='"$(localedir)/%L/%N:$(localedir)/%L/LC_MESSAGES/%N:$(localedir)/%l/%N:$(localedir)/%l/LC_MESSAGES/%N:"'
79 tst-catgets-ENV
= NLSPATH
="$(objpfx)%l/%N.cat" LANG
=de \
80 MALLOC_TRACE
=$(objpfx
)tst-catgets.mtrace \
81 LD_PRELOAD
=$(common-objpfx
)/malloc
/libc_malloc_debug.so
83 ifeq ($(run-built-tests
),yes
)
84 # This test just checks whether the program produces any error or not.
85 # The result is not tested.
86 $(objpfx
)test1.cat
: test1.msg
$(objpfx
)gencat
87 $(built-program-cmd-before-env
) \
88 $(run-program-env
) LC_ALL
=hr_HR.ISO-8859-2 \
89 $(built-program-cmd-after-env
) -H
$(objpfx
)test1.h
$@
$<; \
91 $(objpfx
)test2.cat
: test2.msg
$(objpfx
)gencat
92 $(built-program-cmd
) -H
$(objpfx
)test2.h
$@
$<; \
94 $(objpfx
)de
/libc.cat
: $(objpfx
)de.msg
$(objpfx
)gencat
95 $(make-target-directory
)
96 $(built-program-cmd-before-env
) \
97 $(run-program-env
) LC_ALL
=de_DE.ISO-8859-1 \
98 $(built-program-cmd-after-env
) $@
$<; \
100 $(objpfx
)tst-catgets.out
: $(objpfx
)de
/libc.cat
102 # Generate a non-simple input file.
103 $(objpfx
)de.msg
: xopen-msg.awk
$(..
)po
/de.po
104 LC_ALL
=C
$(AWK
) -f
$^
$< > $@
106 $(objpfx
)test-gencat.out
: test-gencat.sh
$(objpfx
)test-gencat \
107 $(objpfx
)sample.SJIS.cat
108 $(SHELL
) $< $(common-objpfx
) '$(test-program-cmd-before-env)' \
109 '$(run-program-env)' '$(test-program-cmd-after-env)'; \
112 $(objpfx
)sample.SJIS.cat
: sample.SJIS
$(objpfx
)gencat
113 $(built-program-cmd
) -H
$(objpfx
)test-gencat.h
< $(word 1,$^
) > $@
; \
116 $(objpfx
)tst-catgets-mem.out
: $(objpfx
)tst-catgets.out
117 $(common-objpfx
)malloc
/mtrace
$(objpfx
)tst-catgets.mtrace
> $@
; \