diff options
Diffstat (limited to 'tests/i18n/GNUmakefile')
-rw-r--r-- | tests/i18n/GNUmakefile | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/tests/i18n/GNUmakefile b/tests/i18n/GNUmakefile new file mode 100644 index 0000000..c933f57 --- /dev/null +++ b/tests/i18n/GNUmakefile @@ -0,0 +1,95 @@ +TOPDIR = ../.. + +SUBDIRS = + +INCLUDE_LIBS = \ + $(TOPDIR)/src/libwolf.a + +INCLUDE_DIRS = \ + -I$(TOPDIR)/include/wolf -I. + +TEST_BINS = \ + test_gettext$(EXE) + +-include $(TOPDIR)/makefiles/gmake/sub.mk + +test_gettext: $(TOPDIR)/src/libwolf.a + +# create and update the template: +# xgettext --flag=_:1:pass-c-format -d test_gettext -s -o test_gettext.pot test_gettext.c +# +# initial creation of the translation table: +# msginit -l de_CH -o test_gettext_de_CH.po -i test_gettext.pot +# +# merge the changes into the translation tables keeping existing +# translations +# msgmerge -s -U test_gettext_de_CH.po test_gettext.pot +# +# compile message files into binary format: +# msgfmt -c -v -o test_gettext_de.mo test_gettext_de.po +# +# for running make sure (on ARCH at least, check out others): +# - edit /etc/locale.gen +# - locale-gen +# +# - NetBSD needs -lintl for linking, the LANG is defined different (only de) + +%.pot: %.c + xgettext -k_ --flag=_:1:pass-c-format -d test_gettext -s -o $@ $< + touch $@ + +test_gettext_de.po: test_gettext.pot + msgmerge -s -U $@ -i $< + touch $@ + +test_gettext_de_CH.po: test_gettext.pot + msgmerge -s -U $@ -i $< + touch $@ + +%.mo : %.po + msgfmt -c -o $@ $< + +# TODO: big cleanup for GCC compilation flags +# in older gcc (before 4.2.1) we can't switch off warnings selectivly with a +# prage. So gettext misses a format attribute which results in a warning +# test_gettext.c:81: warning: format not a string literal, argument types not checked +# (Solaris 8, NetBSD) +# on Solaris 10 we get a system header conflict if we don't specify -std=c99 +#test_gettext.o : test_gettext.c +# $(CC) -c -g -o $@ $(PLATFORM_COMPILE_FLAGS) $(INCLUDE_DIRS) $< + +# LANG setting differs from platform to platform a little bit :-( +ifeq "$(PLATFORM)" "LINUX" +TEST_LANG = de_CH +endif +ifeq "$(PLATFORM)" "FREEBSD" +TEST_LANG = de_CH.ISO8859-1 +endif +ifeq "$(PLATFORM)" "OPENBSD" +TEST_LANG = de_CH.ISO8859-1 +endif +ifeq "$(PLATFORM)" "SUNOS" +TEST_LANG = de_CH.iso_8859_1 +endif +ifeq "$(PLATFORM)" "CYGWIN" +TEST_LANG = de +endif +ifeq "$(PLATFORM)" "NETBSD" +TEST_LANG = de +endif + +local_test: test_gettext_de.mo test_gettext_de_CH.mo + @echo "Testing gettext.." + @mkdir -p locale/de_CH/LC_MESSAGES + @mkdir -p locale/de/LC_MESSAGES + @cp test_gettext_de.mo locale/de_CH/LC_MESSAGES/test_gettext.mo + @cp test_gettext_de.mo locale/de/LC_MESSAGES/test_gettext.mo + @LANG=$(TEST_LANG) ./test_gettext >/dev/null 2>&1 + +local_all: + +local_clean: + @-rm -f *.mo + @-rm -rf locale + +local_distclean: |