From c4575fe3e4b004b7e7bacbbe93e836a9646c2c3a Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Mon, 14 Dec 2015 22:08:00 +0100 Subject: [PATCH] Sort files and colorful output Bring the Makefile up to par with girara. Signed-off-by: Sebastian Ramacher --- config.mk | 3 +++ po/Makefile | 44 ++++++++++++++++++++++---------------------- 2 files changed, 25 insertions(+), 22 deletions(-) diff --git a/config.mk b/config.mk index 70a9a2e..3b90908 100644 --- a/config.mk +++ b/config.mk @@ -139,6 +139,9 @@ VALGRIND_SUPPRESSION_FILE = zathura.suppression # set to something != 0 if you want verbose build output VERBOSE ?= 0 +# gettext package name +GETTEXT_PACKAGE ?= ${PROJECT} + # colors COLOR ?= 1 diff --git a/po/Makefile b/po/Makefile index e17f0c5..cebea0e 100644 --- a/po/Makefile +++ b/po/Makefile @@ -1,58 +1,58 @@ # See LICENSE file for license and copyright information -PROJECT = zathura -GETTEXT_PACKAGE = $(PROJECT) -CATALOGS = $(wildcard *.po) -LINGUAS ?= $(patsubst %.po, %, $(CATALOGS)) +include ../config.mk +include ../common.mk +include ../colors.mk + +PROJECT = zathura +CATALOGS = $(sort $(wildcard *.po)) +LINGUAS ?= $(patsubst %.po, %, $(CATALOGS)) ifeq ($(LINGUAS),) ALINGUAS = else ALINGUAS = $(shell find $(patsubst %, %.po, $(LINGUAS)) 2>/dev/null) endif -MOS = $(patsubst %, %/LC_MESSAGES/${GETTEXT_PACKAGE}.mo, $(patsubst %.po, %, $(ALINGUAS))) - -include ../config.mk -include ../common.mk +MOS = $(patsubst %, %/LC_MESSAGES/${GETTEXT_PACKAGE}.mo, $(patsubst %.po, %, $(ALINGUAS))) all: ${MOS} clean: $(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 && \ for f in $(^F) ; do \ - echo zathura/$$f >> $@.tmp ; \ + echo girara/$$f >> $@.tmp ; \ done && \ mv $@.tmp $@ -${PROJECT}.pot: POTFILES.in - $(ECHO) regenerate ${PROJECT}.pot - $(QUIET)intltool-update --pot --gettext-package=${PROJECT} +${GETTEXT_PACKAGE}.pot: POTFILES.in + $(ECHO) regenerate $@ + $(QUIET)intltool-update --pot --gettext-package=${GETTEXT_PACKAGE} -update-po: ${PROJECT}.pot - $(ECHO) updating po: files ${CATALOGS} +update-po: ${GETTEXT_PACKAGE}.pot + $(call colorecho,PO,"Updating po files ${CATALOGS}") $(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" ; \ done -%/LC_MESSAGES/${PROJECT}.mo: %.po +%/LC_MESSAGES/${GETTEXT_PACKAGE}.mo: %.po @mkdir -p $(@D) - $(ECHO) msgfmt $(shell echo $< | sed 's/\.po//') + $(call colorecho,MSGFMT,$(shell echo $< | sed 's/\.po//')) $(QUIET)${MSGFMT} ${MSGFMTFLAGS} -c $< -o $@ install: ${MOS} - $(ECHO) installing translations + $(call colorecho,INSTALL,"Install translations") $(QUIET)set -e && for f in $^ ; do \ mkdir -p -m 755 $(DESTDIR)$(LOCALEDIR)/`dirname $$f`; \ install -m 644 $$f $(DESTDIR)$(LOCALEDIR)/`dirname $$f` ; \ done uninstall: ${MOS} - $(ECHO) removing translations + $(call colorecho,UNINSTALL,"Uninstall translations") $(QUIET)set -e && for f in $^ ; do \ - rm -f $(DESTDIR)$(LOCALEDIR)/$$f; \ + rm -f $(LOCALEDIR)/$$f; \ done -.PHONY: all clean update-po install uninstall +.PHONY: all clean install uninstall update-po