mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-28 08:36:01 +01:00
Sort files and colorful output
Bring the Makefile up to par with girara. Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This commit is contained in:
parent
14af953708
commit
c4575fe3e4
2 changed files with 25 additions and 22 deletions
|
@ -139,6 +139,9 @@ VALGRIND_SUPPRESSION_FILE = zathura.suppression
|
||||||
# set to something != 0 if you want verbose build output
|
# set to something != 0 if you want verbose build output
|
||||||
VERBOSE ?= 0
|
VERBOSE ?= 0
|
||||||
|
|
||||||
|
# gettext package name
|
||||||
|
GETTEXT_PACKAGE ?= ${PROJECT}
|
||||||
|
|
||||||
# colors
|
# colors
|
||||||
COLOR ?= 1
|
COLOR ?= 1
|
||||||
|
|
||||||
|
|
44
po/Makefile
44
po/Makefile
|
@ -1,58 +1,58 @@
|
||||||
# See LICENSE file for license and copyright information
|
# See LICENSE file for license and copyright information
|
||||||
|
|
||||||
PROJECT = zathura
|
include ../config.mk
|
||||||
GETTEXT_PACKAGE = $(PROJECT)
|
include ../common.mk
|
||||||
CATALOGS = $(wildcard *.po)
|
include ../colors.mk
|
||||||
LINGUAS ?= $(patsubst %.po, %, $(CATALOGS))
|
|
||||||
|
PROJECT = zathura
|
||||||
|
CATALOGS = $(sort $(wildcard *.po))
|
||||||
|
LINGUAS ?= $(patsubst %.po, %, $(CATALOGS))
|
||||||
ifeq ($(LINGUAS),)
|
ifeq ($(LINGUAS),)
|
||||||
ALINGUAS =
|
ALINGUAS =
|
||||||
else
|
else
|
||||||
ALINGUAS = $(shell find $(patsubst %, %.po, $(LINGUAS)) 2>/dev/null)
|
ALINGUAS = $(shell find $(patsubst %, %.po, $(LINGUAS)) 2>/dev/null)
|
||||||
endif
|
endif
|
||||||
MOS = $(patsubst %, %/LC_MESSAGES/${GETTEXT_PACKAGE}.mo, $(patsubst %.po, %, $(ALINGUAS)))
|
MOS = $(patsubst %, %/LC_MESSAGES/${GETTEXT_PACKAGE}.mo, $(patsubst %.po, %, $(ALINGUAS)))
|
||||||
|
|
||||||
include ../config.mk
|
|
||||||
include ../common.mk
|
|
||||||
|
|
||||||
all: ${MOS}
|
all: ${MOS}
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(QUIET)rm -rf POTFILES.in POTFILES.in.tmp $(patsubst %.po, %, $(CATALOGS)) ${PROJECT}.pot
|
$(QUIET)rm -rf POTFILES.in POTFILES.in.tmp $(patsubst %.po, %, $(CATALOGS)) ${PROJECT}.pot
|
||||||
|
|
||||||
POTFILES.in: $(wildcard ../zathura/*.c)
|
POTFILES.in: $(sort $(wildcard ../girara/*.c))
|
||||||
$(QUIET) set -e && rm -f $@.tmp && touch $@.tmp && \
|
$(QUIET) set -e && rm -f $@.tmp && touch $@.tmp && \
|
||||||
for f in $(^F) ; do \
|
for f in $(^F) ; do \
|
||||||
echo zathura/$$f >> $@.tmp ; \
|
echo girara/$$f >> $@.tmp ; \
|
||||||
done && \
|
done && \
|
||||||
mv $@.tmp $@
|
mv $@.tmp $@
|
||||||
|
|
||||||
${PROJECT}.pot: POTFILES.in
|
${GETTEXT_PACKAGE}.pot: POTFILES.in
|
||||||
$(ECHO) regenerate ${PROJECT}.pot
|
$(ECHO) regenerate $@
|
||||||
$(QUIET)intltool-update --pot --gettext-package=${PROJECT}
|
$(QUIET)intltool-update --pot --gettext-package=${GETTEXT_PACKAGE}
|
||||||
|
|
||||||
update-po: ${PROJECT}.pot
|
update-po: ${GETTEXT_PACKAGE}.pot
|
||||||
$(ECHO) updating po: files ${CATALOGS}
|
$(call colorecho,PO,"Updating po files ${CATALOGS}")
|
||||||
$(QUIET)set -e && for f in ${CATALOGS} ; do \
|
$(QUIET)set -e && for f in ${CATALOGS} ; do \
|
||||||
intltool-update --dist --gettext-package=${PROJECT} `echo $$f | sed 's/\.po//'` ; \
|
intltool-update --dist --gettext-package=${GETTEXT_PACKAGE} `echo $$f | sed 's/\.po//'` ; \
|
||||||
sed -i 's/Report-Msgid-Bugs-To: \\n/Report-Msgid-Bugs-To: http:\/\/bugs.pwmt.org\\n/' "$$f" ; \
|
sed -i 's/Report-Msgid-Bugs-To: \\n/Report-Msgid-Bugs-To: http:\/\/bugs.pwmt.org\\n/' "$$f" ; \
|
||||||
done
|
done
|
||||||
|
|
||||||
%/LC_MESSAGES/${PROJECT}.mo: %.po
|
%/LC_MESSAGES/${GETTEXT_PACKAGE}.mo: %.po
|
||||||
@mkdir -p $(@D)
|
@mkdir -p $(@D)
|
||||||
$(ECHO) msgfmt $(shell echo $< | sed 's/\.po//')
|
$(call colorecho,MSGFMT,$(shell echo $< | sed 's/\.po//'))
|
||||||
$(QUIET)${MSGFMT} ${MSGFMTFLAGS} -c $< -o $@
|
$(QUIET)${MSGFMT} ${MSGFMTFLAGS} -c $< -o $@
|
||||||
|
|
||||||
install: ${MOS}
|
install: ${MOS}
|
||||||
$(ECHO) installing translations
|
$(call colorecho,INSTALL,"Install translations")
|
||||||
$(QUIET)set -e && for f in $^ ; do \
|
$(QUIET)set -e && for f in $^ ; do \
|
||||||
mkdir -p -m 755 $(DESTDIR)$(LOCALEDIR)/`dirname $$f`; \
|
mkdir -p -m 755 $(DESTDIR)$(LOCALEDIR)/`dirname $$f`; \
|
||||||
install -m 644 $$f $(DESTDIR)$(LOCALEDIR)/`dirname $$f` ; \
|
install -m 644 $$f $(DESTDIR)$(LOCALEDIR)/`dirname $$f` ; \
|
||||||
done
|
done
|
||||||
|
|
||||||
uninstall: ${MOS}
|
uninstall: ${MOS}
|
||||||
$(ECHO) removing translations
|
$(call colorecho,UNINSTALL,"Uninstall translations")
|
||||||
$(QUIET)set -e && for f in $^ ; do \
|
$(QUIET)set -e && for f in $^ ; do \
|
||||||
rm -f $(DESTDIR)$(LOCALEDIR)/$$f; \
|
rm -f $(LOCALEDIR)/$$f; \
|
||||||
done
|
done
|
||||||
|
|
||||||
.PHONY: all clean update-po install uninstall
|
.PHONY: all clean install uninstall update-po
|
||||||
|
|
Loading…
Reference in a new issue