]> git.saurik.com Git - apt.git/blame - po/makefile
Mark some bugs as being closed, due to il8n.
[apt.git] / po / makefile
CommitLineData
89409d33
AL
1# -*- make -*-
2
3# This will compile the gettext message catalogues.
4
5# The other make files drop file lists in build/po/domains/DOMAIN/* which
6# is then picked up by this make file to define all the domains and all the
7# source files that compose each domain. It then produces the POT files
8# and then filters the PO files through the per-domain POT file to create
9# the input to msgformat, which is then dumped into a locale directory.
10
11BASE=..
12SUBDIR=po
13
14# Bring in the default rules
15include ../buildlib/defaults.mak
16
17DOMAINS = $(notdir $(wildcard $(PO_DOMAINS)/*))
18POTFILES := $(addsuffix .pot,$(addprefix $(PO)/,$(DOMAINS)))
19
20# Construct a list of all mo files for all domains under $(PO_DOMAINS)
21MOFILES := $(patsubst %.gmo,%.mo,$(CATALOGS))
22MOFILES := $(foreach D,$(DOMAINS),$(addprefix $(PO_DOMAINS)/$(D)/,$(MOFILES)))
23LANG_POFILES := $(patsubst %.mo,%.po,$(MOFILES))
24LINGUAS := $(patsubst %.gmo,%,$(CATALOGS))
25
26GETDOMAIN = $(filter $(DOMAINS),$(subst /, ,$(1)))
27# Generate the list of files from the bits the other make files dropped
28# and produce the .pot file.
29$(POTFILES) : $(PO)/%.pot :
209836e2 30 printf "%s " "Generating POT file $@"
89409d33
AL
31 echo $@ : $(wildcard $(PO)/domains/$*/*.*list) $(addprefix $(BASE)/,$(shell cat $(wildcard $(PO)/domains/$*/*.srclist))) > $@.d
32# From sh source
33 cat $(PO)/domains/$*/*.shlist 2> /dev/null | (cd $(BASE) && xargs -n1 bash --dump-po-strings) > $(PO)/domains/$*/sh.pot
34# From C/C++ source
35 cat $(PO)/domains/$*/*.srclist > $(PO)/POTFILES_$*.in
36 $(XGETTEXT) --default-domain=$* --directory=$(BASE) \
37 --add-comments --foreign --keyword=_ --keyword=N_ \
38 --files-from=$(PO)/POTFILES_$*.in -o $(PO)/domains/$*/c.pot
39 rm -f $(PO)/POTFILES_$*.in
40 $(MSGCOMM) --more-than=0 $(PO)/domains/$*/c.pot $(PO)/domains/$*/sh.pot --output=$@
41
42$(PO)/$(PACKAGE)-all.pot: $(POTFILES)
43 $(MSGCOMM) --more-than=0 $(POTFILES) --output=$@
44
45# Filter the complete translation with the domain specific file to produce
46# only the subtext needed for this domain
47# We cannot express the dependencies required for this directly with a pattern
48# rule, so we use the .d hack.
c54ea1d7 49$(LANG_POFILES) : %.po : $(PO)/$(PACKAGE)-all.pot
209836e2 50 printf "%s " "Generating $@"
89409d33
AL
51 echo $@ : $(notdir $@) $(PO)/$(call GETDOMAIN,$*).pot > $(PO)/$(call GETDOMAIN,$*)_$(notdir $@).d
52 $(MSGMERGE) $(notdir $@) $(PO)/$(call GETDOMAIN,$*).pot -o $@
53
54$(MOFILES) : %.mo : %.po
209836e2 55 printf "%s: " "Generating $(LOCALE)/$(notdir $*)/LC_MESSAGES/$(call GETDOMAIN,$*).mo"
89409d33
AL
56 $(GMSGFMT) --statistics -o $@ $<
57 mkdir -p $(LOCALE)/$(notdir $*)/LC_MESSAGES/
58 cp $@ $(LOCALE)/$(notdir $*)/LC_MESSAGES/$(call GETDOMAIN,$*).mo
59
60binary: $(POTFILES) $(PO)/$(PACKAGE)-all.pot $(MOFILES)
61
62clean: clean/local
63clean/local:
64 rm -f $(MOFILES) $(LANG_POFILES) $(PO)/*.d
65
66# Include the dependencies that are available
67The_DFiles = $(wildcard $(PO)/*.d)
68ifneq ($(words $(The_DFiles)),0)
69include $(The_DFiles)
70endif
209836e2
AL
71
72.NOTPARALLEL: