2012-03-04 18:35:16 +01:00
|
|
|
# See LICENSE file for license and copyright information
|
|
|
|
|
|
|
|
PROJECT = zathura
|
2012-06-25 18:27:01 +02:00
|
|
|
GETTEXT_PACKAGE = $(PROJECT)
|
2012-06-16 14:19:12 +02:00
|
|
|
CATALOGS = $(wildcard *.po)
|
|
|
|
LINGUAS ?= $(patsubst %.po, %, $(CATALOGS))
|
2012-12-13 14:01:40 +01:00
|
|
|
ifeq ($(LINGUAS),)
|
|
|
|
ALINGUAS =
|
|
|
|
else
|
|
|
|
ALINGUAS = $(shell find $(patsubst %, %.po, $(LINGUAS)) 2>/dev/null)
|
|
|
|
endif
|
2012-06-25 18:27:01 +02:00
|
|
|
MOS = $(patsubst %, %/LC_MESSAGES/${GETTEXT_PACKAGE}.mo, $(patsubst %.po, %, $(ALINGUAS)))
|
|
|
|
|
2012-03-04 18:35:16 +01:00
|
|
|
include ../config.mk
|
|
|
|
include ../common.mk
|
|
|
|
|
|
|
|
all: ${MOS}
|
|
|
|
|
|
|
|
clean:
|
2012-03-08 18:32:46 +01:00
|
|
|
$(QUIET)rm -rf POTFILES.in POTFILES.in.tmp $(patsubst %.po, %, $(CATALOGS)) ${PROJECT}.pot
|
2012-03-04 18:35:16 +01:00
|
|
|
|
2014-11-08 12:32:05 +01:00
|
|
|
POTFILES.in: $(wildcard ../zathura/*.c)
|
2012-03-04 18:35:16 +01:00
|
|
|
$(QUIET) set -e && rm -f $@.tmp && touch $@.tmp && \
|
|
|
|
for f in $(^F) ; do \
|
2014-11-08 12:32:05 +01:00
|
|
|
echo zathura/$$f >> $@.tmp ; \
|
2012-03-04 18:35:16 +01:00
|
|
|
done && \
|
|
|
|
mv $@.tmp $@
|
|
|
|
|
|
|
|
${PROJECT}.pot: POTFILES.in
|
|
|
|
$(ECHO) regenerate ${PROJECT}.pot
|
|
|
|
$(QUIET)intltool-update --pot --gettext-package=${PROJECT}
|
|
|
|
|
2012-03-08 18:03:19 +01:00
|
|
|
update-po: ${PROJECT}.pot
|
|
|
|
$(ECHO) updating po: files ${CATALOGS}
|
|
|
|
$(QUIET)set -e && for f in ${CATALOGS} ; do \
|
|
|
|
intltool-update --dist --gettext-package=${PROJECT} `echo $$f | sed 's/\.po//'` ; \
|
2012-12-07 15:30:13 +01:00
|
|
|
sed -i 's/Report-Msgid-Bugs-To: \\n/Report-Msgid-Bugs-To: http:\/\/bugs.pwmt.org\\n/' "$$f" ; \
|
2012-03-08 18:03:19 +01:00
|
|
|
done
|
2012-03-04 18:35:16 +01:00
|
|
|
|
|
|
|
%/LC_MESSAGES/${PROJECT}.mo: %.po
|
|
|
|
@mkdir -p $(@D)
|
|
|
|
$(ECHO) msgfmt $(shell echo $< | sed 's/\.po//')
|
2012-03-14 22:24:25 +01:00
|
|
|
$(QUIET)${MSGFMT} ${MSGFMTFLAGS} -c $< -o $@
|
2012-03-04 18:35:16 +01:00
|
|
|
|
|
|
|
install: ${MOS}
|
|
|
|
$(ECHO) installing translations
|
|
|
|
$(QUIET)set -e && for f in $^ ; do \
|
2012-04-20 01:16:39 +02:00
|
|
|
mkdir -p -m 755 $(DESTDIR)$(LOCALEDIR)/`dirname $$f`; \
|
2012-03-04 18:35:16 +01:00
|
|
|
install -m 644 $$f $(DESTDIR)$(LOCALEDIR)/`dirname $$f` ; \
|
|
|
|
done
|
2012-03-07 15:32:11 +01:00
|
|
|
|
|
|
|
uninstall: ${MOS}
|
|
|
|
$(ECHO) removing translations
|
|
|
|
$(QUIET)set -e && for f in $^ ; do \
|
2015-03-23 14:18:45 +01:00
|
|
|
rm -f $(DESTDIR)$(LOCALEDIR)/$$f; \
|
2012-03-07 15:32:11 +01:00
|
|
|
done
|
2012-03-08 18:03:19 +01:00
|
|
|
|
|
|
|
.PHONY: all clean update-po install uninstall
|