Makefile 777 Bytes
Newer Older
Dicson's avatar
Dicson committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
PYFILES = $(shell find ../ -type f -name "*.py")
GLADEFILES = $(wildcard ../*.ui)
POFILES = $(wildcard *.po)

GLADEHFILES := $(GLADEFILES:.ui=.ui.h)

help:
	@echo "USAGE:"
	@echo "make update - updates messages.pot and .po files"
	@echo "make sr.po  - updates sr.po file OR creates new one"
	@echo "              (replace 'sr' with your language code)"

%.h: %
	intltool-extract --type="gettext/glade" $*


messages.pot: $(GLADEHFILES) $(PYFILES)
	xgettext -k_ -kN_ -o setlocation.pot $(PYFILES) $(GLADEHFILES) --from-code=utf-8

%.po: messages.pot
	@if test -f $@; then \
		echo -n "Updating '$*' language ";\
		msgmerge -U $@ setlocation.pot;\
	else \
		msginit -l $*.UTF8 -o $@; \
	fi
	$(RM) $(GLADEHFILES)

update: $(POFILES)

clean:
	$(RM) $(GLADEHFILES)

.PHONY:  update