]> git.donarmstrong.com Git - lilypond.git/blob - stepmake/stepmake/po-targets.make
Merge branch 'master' into translation
[lilypond.git] / stepmake / stepmake / po-targets.make
1 XGETTEXT_OPTIONS = \
2         --default-domain=$(package) \
3         --from-code=UTF-8 \
4         --join \
5         --add-comments \
6         --msgid-bugs-address="http://post.gmane.org/post.php?group=gmane.comp.gnu.lilypond.bugs" \
7         --package-name=$(package) \
8         --package-version=$(VERSION)
9
10 sed-header = \# Translation of LilyPond\n\# Copyright \(C\) 1998--2012 Han-Wen Nienhuys, Jan Nieuwenhuizen.\n\# This file is distributed under the same license as the LilyPond package.
11 sed-content = "Content-Type: text\/plain; charset=UTF-8\\n"
12
13 ####
14 #### UGH!
15 new-po:
16         if test -r $(po-dir); then \
17           rm -f $(po-dir)/$(outdir)/$(package).po; \
18           touch $(po-dir)/$(outdir)/$(package).po; \
19         fi
20
21 ifeq ($(strip $(depth)),.)
22 po: new-po
23         $(LOOP)
24 local-po:
25         @true
26 else
27 po: local-po
28         $(LOOP)
29 ALL_PO_SOURCES = $(ALL_C_SOURCES) $(ALL_CC_SOURCES) $(PYTHON_SCRIPTS_IN) $(PY_MODULES_IN) $(SCM_FILES) $(wildcard $(outdir)/*.hh) $(wildcard $(outdir)/*.cc)
30 local-po:
31 ifneq ($(strip $(ALL_PO_SOURCES)),)
32         @echo $(ALL_PO_SOURCES)
33         xgettext $(XGETTEXT_OPTIONS) --output-dir=$(po-dir)/$(outdir) \
34          --keyword=_ --keyword=_f --keyword=_i \
35          $(XGETTEXT_FLAGS) $(ALL_PO_SOURCES)
36 endif
37 endif
38         sed -i '1,2d' $(po-dir)/$(outdir)/$(package).po
39         sed -i -e 's/^\# This file is distributed.*/$(sed-header)/' $(po-dir)/$(outdir)/$(package).po
40         sed -i -e 's/^\"Content-Type: text\/plain.*/$(sed-content)/' $(po-dir)/$(outdir)/$(package).po
41
42
43 po-update: po
44         $(MAKE) -C $(po-dir) po-update
45
46 po-changes:
47         $(MAKE) -C $(po-dir) po-changes
48
49 po-replace: po
50         $(MAKE) -C $(po-dir) po-replace