# file: src/web-interfaces/pub/i18n/Makefile
#
#  2001 OpenCA Group

TOP	= ../../../..
include $(TOP)/Makefile.global-vars

LANGUAGES = \
	C	\
	de_DE	\
	es_ES	\
	fr_FR	\
	it_IT

DIR_HTDOCS = htdocs
DIR_CRL    = htdocs/crl
DIR_SHEETS = sheets
DIR_INC    = sheets/inc

FILTER_HTDOCS = $(DIR_HTDOCS)/*.html
FILTER_CRL    = $(DIR_CRL)/*.html
FILTER_SHEETS = $(DIR_SHEETS)/*.html
FILTER_INC    = $(DIR_INC)/*.inc

#---- variable settings above, rules below ----

.PHONY:	default install clean distclean

default::

language::
	@if [ $(language) != "C" ]; then \
		set -x; \
		cd C; \
		$(TAR) -cf - -X ../i18n.exclude * | $(TAR) xf - -C ../$(language); \
		cd ..; \
		$(PERL) ../../../common/lib/locale/hxgettext -t -l $(language) $(language)/$(FILTER_HTDOCS); \
		$(PERL) ../../../common/lib/locale/hxgettext -t -l $(language) $(language)/$(FILTER_CRL); \
		$(PERL) ../../../common/lib/locale/hxgettext -t -l $(language) $(language)/$(FILTER_SHEETS); \
		$(PERL) ../../../common/lib/locale/hxgettext -t -l $(language) $(language)/$(FILTER_INC); \
	fi;

$(LANGUAGES)::
		cd $@ && $(MAKE) $(SUBTARGET)

install clean distclean::
		$(MAKE) $(language) SUBTARGET=$@

distclean::
		$(RM) $(AC_PROGS)
