]> git.donarmstrong.com Git - lilypond.git/commitdiff
Makes 'make po-replace' work outside source tree
authorJohn Mandereau - LilyPond development <john.mandereau@gmail.com>
Mon, 11 Jun 2012 11:41:38 +0000 (13:41 +0200)
committerJohn Mandereau - LilyPond development <john.mandereau@gmail.com>
Tue, 12 Jun 2012 09:18:02 +0000 (11:18 +0200)
This commit goes towards fixing Issue 2524.

stepmake/stepmake/generic-vars.make
stepmake/stepmake/po-targets.make
stepmake/stepmake/podir-targets.make

index 06fa0a9ab2dec95b8ba62faf1370325ddc81e7d8..5eba1cc214b034a2606ced700d4092819a83969b 100644 (file)
@@ -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.
index bb6215cf3025161afd1a5b7452f9e2abdfb011b9..c971e513c034b8dcc6e45ef4ae05db00ea33370c 100644 (file)
@@ -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
index fdfa5ef33f472194b1701629b34edc85a8dd1f8f..fd66e55809d79d6c30532090fa8b1d01dc9eb9aa 100644 (file)
@@ -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