Commit f5ac0641 authored by Dominik Brodowski's avatar Dominik Brodowski

cpupowerutils: do not update po files on each and every compile

Signed-off-by: default avatarDominik Brodowski <linux@dominikbrodowski.net>
parent 7443af9c
...@@ -95,6 +95,8 @@ HOSTCC = gcc ...@@ -95,6 +95,8 @@ HOSTCC = gcc
# set up PWD so that older versions of make will work with our build. # set up PWD so that older versions of make will work with our build.
PWD = $(shell pwd) PWD = $(shell pwd)
GMO_FILES = ${shell for HLANG in ${LANGUAGES}; do echo po/$$HLANG.gmo; done;}
export CROSS CC AR STRIP RANLIB CFLAGS LDFLAGS LIB_OBJS export CROSS CC AR STRIP RANLIB CFLAGS LDFLAGS LIB_OBJS
# check if compiler option is supported # check if compiler option is supported
...@@ -134,7 +136,7 @@ CFLAGS += -pipe ...@@ -134,7 +136,7 @@ CFLAGS += -pipe
ifeq ($(strip $(NLS)),true) ifeq ($(strip $(NLS)),true)
INSTALL_NLS += install-gmo INSTALL_NLS += install-gmo
COMPILE_NLS += update-gmo COMPILE_NLS += create-gmo
endif endif
ifeq ($(strip $(CPUFRQ_BENCH)),true) ifeq ($(strip $(CPUFRQ_BENCH)),true)
...@@ -195,14 +197,22 @@ cpupower: $(UTIL_OBJS) libcpufreq.so.$(LIB_MAJ) ...@@ -195,14 +197,22 @@ cpupower: $(UTIL_OBJS) libcpufreq.so.$(LIB_MAJ)
$(QUIET) $(STRIPCMD) $@ $(QUIET) $(STRIPCMD) $@
po/$(PACKAGE).pot: $(UTIL_SRC) po/$(PACKAGE).pot: $(UTIL_SRC)
@xgettext --default-domain=$(PACKAGE) --add-comments \ $(ECHO) " GETTEXT " $@
$(QUIET) xgettext --default-domain=$(PACKAGE) --add-comments \
--keyword=_ --keyword=N_ $(UTIL_SRC) && \ --keyword=_ --keyword=N_ $(UTIL_SRC) && \
test -f $(PACKAGE).po && \ test -f $(PACKAGE).po && \
mv -f $(PACKAGE).po po/$(PACKAGE).pot mv -f $(PACKAGE).po po/$(PACKAGE).pot
update-gmo: po/$(PACKAGE).pot po/%.gmo: po/%.po
@for HLANG in $(LANGUAGES); do \ $(ECHO) " MSGFMT " $@
echo -n "Translating $$HLANG "; \ $(QUIET) msgfmt -o $@ po/$*.po
create-gmo: ${GMO_FILES}
update-po: po/$(PACKAGE).pot
$(ECHO) " MSGMRG " $@
$(QUIET) @for HLANG in $(LANGUAGES); do \
echo -n "Updating $$HLANG "; \
if msgmerge po/$$HLANG.po po/$(PACKAGE).pot -o \ if msgmerge po/$$HLANG.po po/$(PACKAGE).pot -o \
po/$$HLANG.new.po; then \ po/$$HLANG.new.po; then \
mv -f po/$$HLANG.new.po po/$$HLANG.po; \ mv -f po/$$HLANG.new.po po/$$HLANG.po; \
...@@ -210,7 +220,6 @@ update-gmo: po/$(PACKAGE).pot ...@@ -210,7 +220,6 @@ update-gmo: po/$(PACKAGE).pot
echo "msgmerge for $$HLANG failed!"; \ echo "msgmerge for $$HLANG failed!"; \
rm -f po/$$HLANG.new.po; \ rm -f po/$$HLANG.new.po; \
fi; \ fi; \
msgfmt --statistics -o po/$$HLANG.gmo po/$$HLANG.po; \
done; done;
compile-bench: libcpufreq.so.$(LIB_MAJ) compile-bench: libcpufreq.so.$(LIB_MAJ)
...@@ -268,5 +277,5 @@ uninstall: ...@@ -268,5 +277,5 @@ uninstall:
rm -f $(DESTDIR)${localedir}/$$HLANG/LC_MESSAGES/cpupowerutils.mo; \ rm -f $(DESTDIR)${localedir}/$$HLANG/LC_MESSAGES/cpupowerutils.mo; \
done; done;
.PHONY: all utils libcpufreq update-po update-gmo install-lib install-tools install-man install-gmo install uninstall \ .PHONY: all utils libcpufreq update-po create-gmo install-lib install-tools install-man install-gmo install uninstall \
clean clean
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment