1 # Copyright (C) 1996-2000, 2002, 2003, 2004 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, write to the Free
16 # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
20 # Makefile for catgets.
24 include ../option-groups.mak
27 distribute = catgetsinfo.h config.h xopen-msg.sed test1.msg test2.msg \
28 test-gencat.sh sample.SJIS
29 routines-$(OPTION_EGLIBC_CATGETS) := catgets open_catalog
30 others-$(OPTION_EGLIBC_CATGETS) := gencat
31 install-bin-$(OPTION_EGLIBC_CATGETS) := gencat
32 extra-objs-$(OPTION_EGLIBC_CATGETS) := $(gencat-modules:=.o)
34 tests-$(OPTION_EGLIBC_CATGETS) := tst-catgets
35 test-srcs-$(OPTION_EGLIBC_CATGETS) := test-gencat
37 gencat-modules = xmalloc
40 vpath %.c ../locale/programs
45 $(objpfx)gencat: $(gencat-modules:%=$(objpfx)%.o)
47 catgets-CPPFLAGS := -DNLSPATH='"$(msgcatdir)/%L/%N:$(msgcatdir)/%L/LC_MESSAGES/%N:$(msgcatdir)/%l/%N:$(msgcatdir)/%l/LC_MESSAGES/%N:"' \
50 CPPFLAGS-gencat = -DNOT_IN_libc
52 generated = de.msg test1.cat test1.h test2.cat test2.h sample.SJIS.cat \
56 tst-catgets-ENV = NLSPATH="$(objpfx)%l/%N.cat" LANG=de
58 # eglibc: ifneq ($(cross-compiling),yes)
59 ifeq (y,$(OPTION_EGLIBC_CATGETS))
60 tests: $(objpfx)de/libc.cat $(objpfx)test1.cat $(objpfx)test2.cat \
61 $(objpfx)test-gencat.out
63 # This test just checks whether the program produces any error or not.
64 # The result is not tested.
65 $(objpfx)test1.cat: test1.msg $(objpfx)gencat
66 LC_ALL=hr_HR.ISO-8859-2 LOCPATH=$(common-objpfx)localedata \
67 GCONV_PATH=$(common-objpfx)iconvdata \
68 $(built-program-cmd) -H $(objpfx)test1.h $@ $<
69 $(objpfx)test2.cat: test2.msg $(objpfx)gencat
70 LOCPATH=$(common-objpfx)localedata \
71 GCONV_PATH=$(common-objpfx)iconvdata \
72 $(built-program-cmd) -H $(objpfx)test2.h $@ $<
73 $(objpfx)de/libc.cat: $(objpfx)de.msg $(objpfx)gencat
74 $(make-target-directory)
75 LC_ALL=de_DE.ISO-8859-1 LOCPATH=$(common-objpfx)localedata \
76 GCONV_PATH=$(common-objpfx)iconvdata $(built-program-cmd) $@ $<
77 $(objpfx)tst-catgets.out: $(objpfx)de/libc.cat
79 # Generate a non-simple input file.
80 $(objpfx)de.msg: $(..)po/de.po
81 LC_ALL=C sed -f xopen-msg.sed $< > $@
83 $(objpfx)test-gencat.out: test-gencat.sh $(objpfx)test-gencat \
84 $(objpfx)sample.SJIS.cat
85 $(SHELL) -e $< $(common-objpfx) '$(built-program-cmd)'
87 $(objpfx)sample.SJIS.cat: sample.SJIS $(objpfx)gencat
88 GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \
89 $(built-program-cmd) -H $(objpfx)test-gencat.h < $(word 1,$^) > $@