# file: src/common/lib/locale/Makefile
#
#  2001 OpenCA Group

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

SUBDIRS	= \
	de_DE	\
	es_ES	\
	fr_FR	\
	it_IT

DEST_DIR	=	${lib_prefix}/locale
DEST_LOCALE_DIRS	=	$(SUBDIRS:%=$(DEST_DIR)/%)

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

.PHONY:	default test install clean clean.local distclean openca.pot openca-html.pot

default::	$(SUBDIRS)

install::	$(DEST_LOCALE_DIRS) $(SUBDIRS)

$(DEST_LOCALE_DIRS)::
		$(INSTALL) -d -o ${openca_user} -g ${openca_group} $@
		$(INSTALL) -d -o ${openca_user} -g ${openca_group} $@/LC_MESSAGES

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

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

openca.pot:
	xgettext -L C -ki18nGettext -D ../../.. -f openca.files -o $@

openca-html.pot:
	cat openca-html.files | ( cd ../../..; \
		xargs $(PERL) common/lib/locale/hxgettext -x \
			-e common/lib/locale/openca-html.exclude ) > $@

distclean::
		#$(RM)
