zathura/po/Makefile

52 lines
1.4 KiB
Makefile
Raw Normal View History

2012-03-04 18:35:16 +01:00
# See LICENSE file for license and copyright information
PROJECT = zathura
2012-06-16 14:19:12 +02:00
CATALOGS = $(wildcard *.po)
LINGUAS ?= $(patsubst %.po, %, $(CATALOGS))
2012-06-17 00:28:42 +02:00
MOS = $(patsubst %, %/LC_MESSAGES/${PROJECT}.mo, $(LINGUAS))
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
POTFILES.in: $(wildcard ../*.c)
$(QUIET) set -e && rm -f $@.tmp && touch $@.tmp && \
for f in $(^F) ; do \
echo $$f >> $@.tmp ; \
done && \
mv $@.tmp $@
${PROJECT}.pot: POTFILES.in
$(ECHO) regenerate ${PROJECT}.pot
$(QUIET)intltool-update --pot --gettext-package=${PROJECT}
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//'` ; \
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
uninstall: ${MOS}
$(ECHO) removing translations
$(QUIET)set -e && for f in $^ ; do \
rm -f $(LOCALEDIR)/$$f; \
done
.PHONY: all clean update-po install uninstall