]>
Commit | Line | Data |
---|---|---|
6d7e8eda | 1 | # Copyright (C) 1996-2023 Free Software Foundation, Inc. |
a641835a RM |
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 | |
41bdb6e2 AJ |
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. | |
a641835a RM |
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 | |
41bdb6e2 | 12 | # Lesser General Public License for more details. |
a641835a | 13 | |
41bdb6e2 | 14 | # You should have received a copy of the GNU Lesser General Public |
59ba27a6 | 15 | # License along with the GNU C Library; if not, see |
5a82c748 | 16 | # <https://www.gnu.org/licenses/>. |
a641835a RM |
17 | |
18 | # | |
19 | # Makefile for catgets. | |
20 | # | |
21 | subdir := catgets | |
22 | ||
a5f891ac JM |
23 | include ../Makeconfig |
24 | ||
5729b8ff CD |
25 | headers = \ |
26 | nl_types.h \ | |
27 | # headers | |
28 | routines = \ | |
29 | catgets \ | |
30 | open_catalog \ | |
31 | # routines | |
a641835a RM |
32 | others = gencat |
33 | install-bin = gencat | |
61eb22d3 | 34 | extra-objs = $(gencat-modules:=.o) |
a641835a | 35 | |
04ba8790 | 36 | tests = tst-catgets |
14d5391f | 37 | test-srcs = test-gencat |
04ba8790 | 38 | |
f214606a | 39 | ifeq ($(run-built-tests),yes) |
5729b8ff CD |
40 | tests-special += \ |
41 | $(objpfx)de/libc.cat \ | |
42 | $(objpfx)sample.SJIS.cat \ | |
43 | $(objpfx)test-gencat.out \ | |
44 | $(objpfx)test1.cat \ | |
45 | $(objpfx)test2.cat \ | |
46 | $(objpfx)tst-catgets-mem.out | |
47 | # tests-special | |
f214606a JM |
48 | endif |
49 | ||
a641835a | 50 | gencat-modules = xmalloc |
7b3ce395 | 51 | others-extras = $(gencat-modules) |
a641835a RM |
52 | |
53 | # To find xmalloc.c | |
54 | vpath %.c ../locale/programs | |
55 | ||
56 | ||
57 | include ../Rules | |
58 | ||
59 | $(objpfx)gencat: $(gencat-modules:%=$(objpfx)%.o) | |
60 | ||
314f6dee | 61 | catgets-CPPFLAGS := -DNLSPATH='"$(localedir)/%L/%N:$(localedir)/%L/LC_MESSAGES/%N:$(localedir)/%l/%N:$(localedir)/%l/LC_MESSAGES/%N:"' |
3e300ca1 | 62 | |
5729b8ff CD |
63 | generated += \ |
64 | de.msg \ | |
65 | sample.SJIS.cat \ | |
66 | test-gencat.h \ | |
67 | test1.cat \ | |
68 | test1.h \ | |
69 | test2.cat \ | |
70 | test2.h \ | |
71 | tst-catgets-mem.out \ | |
72 | tst-catgets.mtrace \ | |
73 | # generated | |
74 | ||
75 | generated-dirs += \ | |
76 | de \ | |
77 | # generated-dirs | |
04ba8790 | 78 | |
2d2d9f2b SP |
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 | |
3e300ca1 | 82 | |
03ac099f | 83 | ifeq ($(run-built-tests),yes) |
3e300ca1 UD |
84 | # This test just checks whether the program produces any error or not. |
85 | # The result is not tested. | |
646fffb9 | 86 | $(objpfx)test1.cat: test1.msg $(objpfx)gencat |
8540f6d2 JM |
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 $@ $<; \ | |
f0881698 | 90 | $(evaluate-test) |
c780aa21 | 91 | $(objpfx)test2.cat: test2.msg $(objpfx)gencat |
f0881698 JM |
92 | $(built-program-cmd) -H $(objpfx)test2.h $@ $<; \ |
93 | $(evaluate-test) | |
04ba8790 | 94 | $(objpfx)de/libc.cat: $(objpfx)de.msg $(objpfx)gencat |
8719e0fd | 95 | $(make-target-directory) |
8540f6d2 JM |
96 | $(built-program-cmd-before-env) \ |
97 | $(run-program-env) LC_ALL=de_DE.ISO-8859-1 \ | |
98 | $(built-program-cmd-after-env) $@ $<; \ | |
f0881698 | 99 | $(evaluate-test) |
04ba8790 | 100 | $(objpfx)tst-catgets.out: $(objpfx)de/libc.cat |
3e300ca1 UD |
101 | |
102 | # Generate a non-simple input file. | |
704bc459 AS |
103 | $(objpfx)de.msg: xopen-msg.awk $(..)po/de.po |
104 | LC_ALL=C $(AWK) -f $^ $< > $@ | |
14d5391f UD |
105 | |
106 | $(objpfx)test-gencat.out: test-gencat.sh $(objpfx)test-gencat \ | |
107 | $(objpfx)sample.SJIS.cat | |
8540f6d2 JM |
108 | $(SHELL) $< $(common-objpfx) '$(test-program-cmd-before-env)' \ |
109 | '$(run-program-env)' '$(test-program-cmd-after-env)'; \ | |
f0881698 | 110 | $(evaluate-test) |
14d5391f UD |
111 | |
112 | $(objpfx)sample.SJIS.cat: sample.SJIS $(objpfx)gencat | |
6f99f280 JM |
113 | $(built-program-cmd) -H $(objpfx)test-gencat.h < $(word 1,$^) > $@; \ |
114 | $(evaluate-test) | |
0f585390 PP |
115 | |
116 | $(objpfx)tst-catgets-mem.out: $(objpfx)tst-catgets.out | |
117 | $(common-objpfx)malloc/mtrace $(objpfx)tst-catgets.mtrace > $@; \ | |
118 | $(evaluate-test) | |
ac72fbb1 | 119 | endif |