]>
Commit | Line | Data |
---|---|---|
04277e02 | 1 | # Copyright (C) 1996-2019 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 PE |
15 | # License along with the GNU C Library; if not, see |
16 | # <http://www.gnu.org/licenses/>. | |
a641835a RM |
17 | |
18 | # | |
19 | # Makefile for catgets. | |
20 | # | |
21 | subdir := catgets | |
22 | ||
a5f891ac JM |
23 | include ../Makeconfig |
24 | ||
a641835a | 25 | headers = nl_types.h |
a641835a RM |
26 | routines = catgets open_catalog |
27 | others = gencat | |
28 | install-bin = gencat | |
61eb22d3 | 29 | extra-objs = $(gencat-modules:=.o) |
a641835a | 30 | |
04ba8790 | 31 | tests = tst-catgets |
14d5391f | 32 | test-srcs = test-gencat |
04ba8790 | 33 | |
f214606a JM |
34 | ifeq ($(run-built-tests),yes) |
35 | tests-special += $(objpfx)de/libc.cat $(objpfx)test1.cat $(objpfx)test2.cat \ | |
6f99f280 | 36 | $(objpfx)sample.SJIS.cat $(objpfx)test-gencat.out |
0f585390 | 37 | tests-special += $(objpfx)tst-catgets-mem.out |
f214606a JM |
38 | endif |
39 | ||
a641835a | 40 | gencat-modules = xmalloc |
7b3ce395 | 41 | others-extras = $(gencat-modules) |
a641835a RM |
42 | |
43 | # To find xmalloc.c | |
44 | vpath %.c ../locale/programs | |
45 | ||
46 | ||
47 | include ../Rules | |
48 | ||
49 | $(objpfx)gencat: $(gencat-modules:%=$(objpfx)%.o) | |
50 | ||
314f6dee | 51 | catgets-CPPFLAGS := -DNLSPATH='"$(localedir)/%L/%N:$(localedir)/%L/LC_MESSAGES/%N:$(localedir)/%l/%N:$(localedir)/%l/LC_MESSAGES/%N:"' |
3e300ca1 | 52 | |
f08e9a26 RM |
53 | generated += de.msg test1.cat test1.h test2.cat test2.h sample.SJIS.cat \ |
54 | test-gencat.h | |
0f585390 PP |
55 | generated += tst-catgets.mtrace tst-catgets-mem.out |
56 | ||
f08e9a26 | 57 | generated-dirs += de |
04ba8790 | 58 | |
0f585390 | 59 | tst-catgets-ENV = NLSPATH="$(objpfx)%l/%N.cat" LANG=de MALLOC_TRACE=$(objpfx)tst-catgets.mtrace |
3e300ca1 | 60 | |
03ac099f | 61 | ifeq ($(run-built-tests),yes) |
3e300ca1 UD |
62 | # This test just checks whether the program produces any error or not. |
63 | # The result is not tested. | |
646fffb9 | 64 | $(objpfx)test1.cat: test1.msg $(objpfx)gencat |
8540f6d2 JM |
65 | $(built-program-cmd-before-env) \ |
66 | $(run-program-env) LC_ALL=hr_HR.ISO-8859-2 \ | |
67 | $(built-program-cmd-after-env) -H $(objpfx)test1.h $@ $<; \ | |
f0881698 | 68 | $(evaluate-test) |
c780aa21 | 69 | $(objpfx)test2.cat: test2.msg $(objpfx)gencat |
f0881698 JM |
70 | $(built-program-cmd) -H $(objpfx)test2.h $@ $<; \ |
71 | $(evaluate-test) | |
04ba8790 | 72 | $(objpfx)de/libc.cat: $(objpfx)de.msg $(objpfx)gencat |
8719e0fd | 73 | $(make-target-directory) |
8540f6d2 JM |
74 | $(built-program-cmd-before-env) \ |
75 | $(run-program-env) LC_ALL=de_DE.ISO-8859-1 \ | |
76 | $(built-program-cmd-after-env) $@ $<; \ | |
f0881698 | 77 | $(evaluate-test) |
04ba8790 | 78 | $(objpfx)tst-catgets.out: $(objpfx)de/libc.cat |
3e300ca1 UD |
79 | |
80 | # Generate a non-simple input file. | |
704bc459 AS |
81 | $(objpfx)de.msg: xopen-msg.awk $(..)po/de.po |
82 | LC_ALL=C $(AWK) -f $^ $< > $@ | |
14d5391f UD |
83 | |
84 | $(objpfx)test-gencat.out: test-gencat.sh $(objpfx)test-gencat \ | |
85 | $(objpfx)sample.SJIS.cat | |
8540f6d2 JM |
86 | $(SHELL) $< $(common-objpfx) '$(test-program-cmd-before-env)' \ |
87 | '$(run-program-env)' '$(test-program-cmd-after-env)'; \ | |
f0881698 | 88 | $(evaluate-test) |
14d5391f UD |
89 | |
90 | $(objpfx)sample.SJIS.cat: sample.SJIS $(objpfx)gencat | |
6f99f280 JM |
91 | $(built-program-cmd) -H $(objpfx)test-gencat.h < $(word 1,$^) > $@; \ |
92 | $(evaluate-test) | |
0f585390 PP |
93 | |
94 | $(objpfx)tst-catgets-mem.out: $(objpfx)tst-catgets.out | |
95 | $(common-objpfx)malloc/mtrace $(objpfx)tst-catgets.mtrace > $@; \ | |
96 | $(evaluate-test) | |
ac72fbb1 | 97 | endif |