
@SET_XGETTEXT@


.SUFFIXES: .man .1 .mo .pdf .po .tex
.PHONY: all default clean distclean updatelang


# @WP2LATEX_MAN@
default: locale/cs/lc_messages/wp2latex.mo locale/de/lc_messages/wp2latex.mo


wp2latex.1: wp2latex.man
	groff -Tascii -man wp2latex.man > wp2latex.1
	
wp2latex.dvi: wp2latex.tex
	latex wp2latex.tex
	latex wp2latex.tex

wp2latex.pdf: wp2latex.tex
	pdflatex wp2latex.tex
	pdflatex wp2latex.tex

locale/cs/lc_messages:
	mkdir -p $@

locale/cs/lc_messages/wp2latex.mo: cs.po | locale/cs/lc_messages
	msgfmt cs.po -o locale/cs/lc_messages/wp2latex.mo


locale/de/lc_messages:
	mkdir -p $@

locale/de/lc_messages/wp2latex.mo: de.po | locale/de/lc_messages
	msgfmt de.po -o locale/de/lc_messages/wp2latex.mo

	
all: @WP2LATEX_MAN@ locale/cs/lc_messages/wp2latex.mo locale/de/lc_messages/wp2latex.mo

clean:
	rm -f *.dvi *.exe *.OBJ *.obj *.bak core *.aux *.log *.toc ref.po
	rm -f *.blg *.bbl *.aux

distclean: clean
	rm -f locale/cs/lc_messages/*.* locale/de/lc_messages/*.* *.1
	rm -f *.pdf


ifeq ($(OS),Windows_NT)
dump.c: ..\bin\win\WP2LaTexGUI.exe
	..\bin\win\WP2LaTexGUI.exe -dumpstrings
endif


#---------Translation updates-----------
ifneq ($(XGETTEXT),)

ref.po: ../sources.cc/*.cc dump.c
	$(XGETTEXT) -o ref_new.po ../sources.cc/*.cc dump.c
	mv ref_new.po ref.po


updatelang: cs.po de.po

cs.po: ref.po
	msgmerge -o cs_new.po cs.po ref.po
	mv cs_new.po cs.po

de.po: ref.po
	msgmerge -o de_new.po de.po ref.po
	mv de_new.po de.po

endif
