LANGUAGES=hu es fr cs de ro

# This makefile is based on Makefile.in (Unix version). It had to be
# simplified in certain places.
LOCALEDIR=..\..\locale
BINDIR=..\..\bin

# If other files will be translated, they must be also here:
CSOURCES=../ui/ui.c ../ui-hlp/menu.c \
../ui-hlp/play.c ../ui-hlp/ui_helper.c \
../engine/zoom.c ../engine/btrace.c \
../ui/dialog.c ../ui/filesel.c ../ui-hlp/render.c



MO-FILES = $(LANGUAGES:=.mo)

PO-FILES = $(LANGUAGES:=.po)

all: $(MO-FILES)

install: $(MO-FILES)
	mkdir $(LOCALEDIR)
	for %i in ( $(LANGUAGES) ) do mkdir $(LOCALEDIR)\%i
	for %i in ( $(LANGUAGES) ) do mkdir $(LOCALEDIR)\%i\LC_MESSAGES
	for %i in ( $(LANGUAGES) ) do cp %i.mo $(LOCALEDIR)\%i\LC_MESSAGES\xaos.mo
	for %i in ( $(LANGUAGES) ) do cp xaos-%i.bat $(BINDIR)

clean:
	rm -f $(MO-FILES)

distclean: clean
	rm Makefile

messages.pot: $(CSOURCES)
	xgettext -o messages.pot $(CSOURCES)

$(PO-FILES): messages.pot
	msgmerge $@ messages.pot > new.tmp
	mv new.tmp $@

$(MO-FILES): $(PO-FILES)
	msgfmt -o $@ -c -v --statistics $(@:.mo=.po)

