From: John Mandereau - LilyPond development Date: Mon, 11 Jun 2012 11:41:38 +0000 (+0200) Subject: Makes 'make po-replace' work outside source tree X-Git-Tag: release/2.15.41-1~53 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=ba45c2d6338d83f8630be6ab3b454eca4d47adec;p=lilypond.git Makes 'make po-replace' work outside source tree This commit goes towards fixing Issue 2524. --- diff --git a/stepmake/stepmake/generic-vars.make b/stepmake/stepmake/generic-vars.make index 06fa0a9ab2..5eba1cc214 100644 --- a/stepmake/stepmake/generic-vars.make +++ b/stepmake/stepmake/generic-vars.make @@ -37,7 +37,8 @@ endif distname = $(package)-$(TOPLEVEL_VERSION) doc-dir = $(src-depth)/Documentation -po-dir = $(src-depth)/po +po-srcdir = $(src-depth)/po +po-outdir = $(depth)/po/$(outdir) step-bindir = $(stepmake)/bin # stepmake package support. diff --git a/stepmake/stepmake/po-targets.make b/stepmake/stepmake/po-targets.make index bb6215cf30..c971e513c0 100644 --- a/stepmake/stepmake/po-targets.make +++ b/stepmake/stepmake/po-targets.make @@ -1,4 +1,6 @@ XGETTEXT_OPTIONS = \ + --directory=$(src-dir) \ + --directory=. \ --default-domain=$(package) \ --from-code=UTF-8 \ --join \ @@ -13,9 +15,10 @@ sed-content = "Content-Type: text\/plain; charset=UTF-8\\n" #### #### UGH! new-po: - if test -r $(po-dir); then \ - rm -f $(po-dir)/$(outdir)/$(package).po; \ - touch $(po-dir)/$(outdir)/$(package).po; \ + if test -r $(po-srcdir); then \ + rm -f $(po-outdir)/$(package).po; \ + mkdir -p $(po-outdir); \ + touch $(po-outdir)/$(package).po; \ fi ifeq ($(strip $(depth)),.) @@ -30,21 +33,21 @@ ALL_PO_SOURCES = $(ALL_C_SOURCES) $(ALL_CC_SOURCES) $(PYTHON_SCRIPTS_IN) $(PY_MO local-po: ifneq ($(strip $(ALL_PO_SOURCES)),) @echo $(ALL_PO_SOURCES) - xgettext $(XGETTEXT_OPTIONS) --output-dir=$(po-dir)/$(outdir) \ + xgettext $(XGETTEXT_OPTIONS) --output-dir=$(po-outdir) \ --keyword=_ --keyword=_f --keyword=_i \ $(XGETTEXT_FLAGS) $(ALL_PO_SOURCES) endif endif - sed -i '1,2d' $(po-dir)/$(outdir)/$(package).po - sed -i -e 's/^\# This file is distributed.*/$(sed-header)/' $(po-dir)/$(outdir)/$(package).po - sed -i -e 's/^\"Content-Type: text\/plain.*/$(sed-content)/' $(po-dir)/$(outdir)/$(package).po + sed -i '1,2d' $(po-outdir)/$(package).po + sed -i -e 's/^\# This file is distributed.*/$(sed-header)/' $(po-outdir)/$(package).po + sed -i -e 's/^\"Content-Type: text\/plain.*/$(sed-content)/' $(po-outdir)/$(package).po po-update: po - $(MAKE) -C $(po-dir) po-update + $(MAKE) -C $(po-outdir)/.. po-update po-changes: - $(MAKE) -C $(po-dir) po-changes + $(MAKE) -C $(po-outdir)/.. po-changes po-replace: po - $(MAKE) -C $(po-dir) po-replace + $(MAKE) -C $(po-outdir)/.. po-replace diff --git a/stepmake/stepmake/podir-targets.make b/stepmake/stepmake/podir-targets.make index fdfa5ef33f..fd66e55809 100644 --- a/stepmake/stepmake/podir-targets.make +++ b/stepmake/stepmake/podir-targets.make @@ -12,19 +12,19 @@ sed-edstuff = -e 's/[ \.,adic0-9]*//' -e 's/---//' | sort -u po-update: $(foreach i,$(CATALOGS), \ - rm -f $(po-dir)/$(outdir)/$(i).po; \ - msgmerge $(po-dir)/$(i).po $(po-dir)/$(outdir)/$(package).po \ - -o $(po-dir)/$(outdir)/$(i).po && ) true + rm -f $(po-outdir)/$(i).po; \ + msgmerge $(po-srcdir)/$(i).po $(po-outdir)/$(package).po \ + -o $(po-outdir)/$(i).po && ) true @$(foreach i,$(CATALOGS), \ - changes=`$(MAKE) --silent -C $(po-dir) LANGUAGE=$i po-changes $(ERROR_LOG) | sed $(sed-makestuff)`; \ + changes=`$(MAKE) --silent -C $(po-outdir)/.. LANGUAGE=$i po-changes $(ERROR_LOG) | sed $(sed-makestuff)`; \ if test "$$changes" != "" ; then \ - echo "*** Changes for language $i; check po/$(outdir)/$i.po ***"; \ + echo "*** Changes for language $i; check $(po-outdir)/$i.po ***"; \ echo -e "changes: \`$$changes'";\ fi && ) true po-changes: - diff -e $(po-dir)/$(outdir)/$(LANGUAGE).po $(po-dir)/$(LANGUAGE).po \ + diff -e $(po-outdir)/$(LANGUAGE).po $(po-srcdir)/$(LANGUAGE).po \ | sed $(sed-pofile) $(sed-edstuff) po-replace: po-update