From adc3b2b27670f123bd7dd742ba0fa0e0a60e1b19 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Sat, 14 May 2011 13:47:45 +0000 Subject: [PATCH] Makefile: add xgettext target for *.sh files MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Change the "pot" target to also extract strings from our $(SCRIPT_SH) files with xgettext(1). Note that due to Jonathan Nieder's trick of doing "mv $@+ $@" at the end of the target the "pot" target will now warn: $ make pot XGETTEXT po/git.pot po/git.pot+: warning: Charset "CHARSET" is not a portable encoding name. Message conversion to user's charset might not work. This warnings is emitted because xgettext is writing into a non-*.pot file, it's harmless however. The content that's written out is equivalent to what it would be if we were writing directly into an existing POT file with --join-existing. As part of this change I've eliminated the && chain between xgettext calls, this is incompatible with $(QUIET_XGETTEXT), if the && is left in it'll emit: /bin/sh: @echo: not found Since it's redundant (the Makefile will stop if there's an error) I've removed it altogether. Signed-off-by: Ævar Arnfjörð Bjarmason Signed-off-by: Junio C Hamano --- Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 83889f378..10252d50a 100644 --- a/Makefile +++ b/Makefile @@ -2065,10 +2065,14 @@ XGETTEXT_FLAGS = \ --from-code=UTF-8 XGETTEXT_FLAGS_C = $(XGETTEXT_FLAGS) --language=C \ --keyword=_ --keyword=N_ --keyword="Q_:1,2" +XGETTEXT_FLAGS_SH = $(XGETTEXT_FLAGS) --language=Shell LOCALIZED_C := $(C_OBJ:o=c) +LOCALIZED_SH := $(SCRIPT_SH) po/git.pot: $(LOCALIZED_C) - $(QUIET_XGETTEXT)$(XGETTEXT) -o$@+ $(XGETTEXT_FLAGS_C) $(LOCALIZED_C) && \ + $(QUIET_XGETTEXT)$(XGETTEXT) -o$@+ $(XGETTEXT_FLAGS_C) $(LOCALIZED_C) + $(QUIET_XGETTEXT)$(XGETTEXT) -o$@+ --join-existing $(XGETTEXT_FLAGS_SH) \ + $(LOCALIZED_SH) mv $@+ $@ pot: po/git.pot -- 2.30.2