diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2011-04-19 12:52:44 -0400 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2011-07-29 12:35:37 -0400 |
commit | f5ac0641d129348399a8f39c95e7a16dc6e19f53 (patch) | |
tree | 489e7eafb48b6b2632ee712686f0dda837dd5584 /tools/power | |
parent | 7443af9c9b99ed8eb1eb4496ca1769adba64776b (diff) |
cpupowerutils: do not update po files on each and every compile
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'tools/power')
-rw-r--r-- | tools/power/cpupower/Makefile | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/tools/power/cpupower/Makefile b/tools/power/cpupower/Makefile index 5d30dadbc4e7..fea0e6a0a37a 100644 --- a/tools/power/cpupower/Makefile +++ b/tools/power/cpupower/Makefile | |||
@@ -95,6 +95,8 @@ HOSTCC = gcc | |||
95 | # set up PWD so that older versions of make will work with our build. | 95 | # set up PWD so that older versions of make will work with our build. |
96 | PWD = $(shell pwd) | 96 | PWD = $(shell pwd) |
97 | 97 | ||
98 | GMO_FILES = ${shell for HLANG in ${LANGUAGES}; do echo po/$$HLANG.gmo; done;} | ||
99 | |||
98 | export CROSS CC AR STRIP RANLIB CFLAGS LDFLAGS LIB_OBJS | 100 | export CROSS CC AR STRIP RANLIB CFLAGS LDFLAGS LIB_OBJS |
99 | 101 | ||
100 | # check if compiler option is supported | 102 | # check if compiler option is supported |
@@ -134,7 +136,7 @@ CFLAGS += -pipe | |||
134 | 136 | ||
135 | ifeq ($(strip $(NLS)),true) | 137 | ifeq ($(strip $(NLS)),true) |
136 | INSTALL_NLS += install-gmo | 138 | INSTALL_NLS += install-gmo |
137 | COMPILE_NLS += update-gmo | 139 | COMPILE_NLS += create-gmo |
138 | endif | 140 | endif |
139 | 141 | ||
140 | ifeq ($(strip $(CPUFRQ_BENCH)),true) | 142 | ifeq ($(strip $(CPUFRQ_BENCH)),true) |
@@ -195,14 +197,22 @@ cpupower: $(UTIL_OBJS) libcpufreq.so.$(LIB_MAJ) | |||
195 | $(QUIET) $(STRIPCMD) $@ | 197 | $(QUIET) $(STRIPCMD) $@ |
196 | 198 | ||
197 | po/$(PACKAGE).pot: $(UTIL_SRC) | 199 | po/$(PACKAGE).pot: $(UTIL_SRC) |
198 | @xgettext --default-domain=$(PACKAGE) --add-comments \ | 200 | $(ECHO) " GETTEXT " $@ |
201 | $(QUIET) xgettext --default-domain=$(PACKAGE) --add-comments \ | ||
199 | --keyword=_ --keyword=N_ $(UTIL_SRC) && \ | 202 | --keyword=_ --keyword=N_ $(UTIL_SRC) && \ |
200 | test -f $(PACKAGE).po && \ | 203 | test -f $(PACKAGE).po && \ |
201 | mv -f $(PACKAGE).po po/$(PACKAGE).pot | 204 | mv -f $(PACKAGE).po po/$(PACKAGE).pot |
202 | 205 | ||
203 | update-gmo: po/$(PACKAGE).pot | 206 | po/%.gmo: po/%.po |
204 | @for HLANG in $(LANGUAGES); do \ | 207 | $(ECHO) " MSGFMT " $@ |
205 | echo -n "Translating $$HLANG "; \ | 208 | $(QUIET) msgfmt -o $@ po/$*.po |
209 | |||
210 | create-gmo: ${GMO_FILES} | ||
211 | |||
212 | update-po: po/$(PACKAGE).pot | ||
213 | $(ECHO) " MSGMRG " $@ | ||
214 | $(QUIET) @for HLANG in $(LANGUAGES); do \ | ||
215 | echo -n "Updating $$HLANG "; \ | ||
206 | if msgmerge po/$$HLANG.po po/$(PACKAGE).pot -o \ | 216 | if msgmerge po/$$HLANG.po po/$(PACKAGE).pot -o \ |
207 | po/$$HLANG.new.po; then \ | 217 | po/$$HLANG.new.po; then \ |
208 | mv -f po/$$HLANG.new.po po/$$HLANG.po; \ | 218 | mv -f po/$$HLANG.new.po po/$$HLANG.po; \ |
@@ -210,7 +220,6 @@ update-gmo: po/$(PACKAGE).pot | |||
210 | echo "msgmerge for $$HLANG failed!"; \ | 220 | echo "msgmerge for $$HLANG failed!"; \ |
211 | rm -f po/$$HLANG.new.po; \ | 221 | rm -f po/$$HLANG.new.po; \ |
212 | fi; \ | 222 | fi; \ |
213 | msgfmt --statistics -o po/$$HLANG.gmo po/$$HLANG.po; \ | ||
214 | done; | 223 | done; |
215 | 224 | ||
216 | compile-bench: libcpufreq.so.$(LIB_MAJ) | 225 | compile-bench: libcpufreq.so.$(LIB_MAJ) |
@@ -268,5 +277,5 @@ uninstall: | |||
268 | rm -f $(DESTDIR)${localedir}/$$HLANG/LC_MESSAGES/cpupowerutils.mo; \ | 277 | rm -f $(DESTDIR)${localedir}/$$HLANG/LC_MESSAGES/cpupowerutils.mo; \ |
269 | done; | 278 | done; |
270 | 279 | ||
271 | .PHONY: all utils libcpufreq update-po update-gmo install-lib install-tools install-man install-gmo install uninstall \ | 280 | .PHONY: all utils libcpufreq update-po create-gmo install-lib install-tools install-man install-gmo install uninstall \ |
272 | clean | 281 | clean |