]> git.ipfire.org Git - thirdparty/glibc.git/blob - catgets/Makefile
7c2a1170e1fefa4323b52d96999baf6e102db4d3
[thirdparty/glibc.git] / catgets / Makefile
1 # Copyright (C) 1996-2014 Free Software Foundation, Inc.
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
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.
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
12 # Lesser General Public License for more details.
13
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 # <http://www.gnu.org/licenses/>.
17
18 #
19 # Makefile for catgets.
20 #
21 subdir := catgets
22
23 headers = nl_types.h
24 routines = catgets open_catalog
25 others = gencat
26 install-bin = gencat
27 extra-objs = $(gencat-modules:=.o)
28
29 tests = tst-catgets
30 test-srcs = test-gencat
31
32 gencat-modules = xmalloc
33
34 # To find xmalloc.c
35 vpath %.c ../locale/programs
36
37
38 include ../Rules
39
40 $(objpfx)gencat: $(gencat-modules:%=$(objpfx)%.o)
41
42 catgets-CPPFLAGS := -DNLSPATH='"$(msgcatdir)/%L/%N:$(msgcatdir)/%L/LC_MESSAGES/%N:$(msgcatdir)/%l/%N:$(msgcatdir)/%l/LC_MESSAGES/%N:"' \
43 -DHAVE_CONFIG_H
44
45 CPPFLAGS-gencat = -DNOT_IN_libc
46
47 generated = de.msg test1.cat test1.h test2.cat test2.h sample.SJIS.cat \
48 test-gencat.h
49 generated-dirs = de
50
51 tst-catgets-ENV = NLSPATH="$(objpfx)%l/%N.cat" LANG=de
52
53 ifeq ($(run-built-tests),yes)
54 tests: $(objpfx)de/libc.cat $(objpfx)test1.cat $(objpfx)test2.cat \
55 $(objpfx)test-gencat.out
56 # This test just checks whether the program produces any error or not.
57 # The result is not tested.
58 $(objpfx)test1.cat: test1.msg $(objpfx)gencat
59 LC_ALL=hr_HR.ISO-8859-2 LOCPATH=$(common-objpfx)localedata \
60 GCONV_PATH=$(common-objpfx)iconvdata \
61 $(built-program-cmd) -H $(objpfx)test1.h $@ $<; \
62 $(evaluate-test)
63 $(objpfx)test2.cat: test2.msg $(objpfx)gencat
64 LOCPATH=$(common-objpfx)localedata \
65 GCONV_PATH=$(common-objpfx)iconvdata \
66 $(built-program-cmd) -H $(objpfx)test2.h $@ $<; \
67 $(evaluate-test)
68 $(objpfx)de/libc.cat: $(objpfx)de.msg $(objpfx)gencat
69 $(make-target-directory)
70 LC_ALL=de_DE.ISO-8859-1 LOCPATH=$(common-objpfx)localedata \
71 GCONV_PATH=$(common-objpfx)iconvdata $(built-program-cmd) $@ $<; \
72 $(evaluate-test)
73 $(objpfx)tst-catgets.out: $(objpfx)de/libc.cat
74
75 # Generate a non-simple input file.
76 $(objpfx)de.msg: xopen-msg.awk $(..)po/de.po
77 LC_ALL=C $(AWK) -f $^ $< > $@
78
79 $(objpfx)test-gencat.out: test-gencat.sh $(objpfx)test-gencat \
80 $(objpfx)sample.SJIS.cat
81 $(SHELL) $< $(common-objpfx) '$(test-program-cmd)'; \
82 $(evaluate-test)
83
84 $(objpfx)sample.SJIS.cat: sample.SJIS $(objpfx)gencat
85 GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \
86 $(built-program-cmd) -H $(objpfx)test-gencat.h < $(word 1,$^) > $@
87 endif