1 # Generate .po and .mo files. For the gettext library (aka libintl),
9 GETTEXT_PACKAGE
= xcsoar
10 GETTEXT_SOURCES
= $(XCSOAR_SOURCES
) \
11 $(wildcard $(SRC
)/Dialogs
/Vega
/*Parameters.hpp
) \
12 $(SRC
)/Terrain
/RasterWeather.
cpp
13 GETTEXT_DIALOGS
= $(wildcard Data
/Dialogs
/*.xml
)
14 GETTEXT_DIALOGS
+= $(wildcard Data
/Dialogs
/Configuration
/*.xml
)
15 GETTEXT_EVENTS
= Data
/Input
/default.xci
16 PO_FILES
= $(wildcard po
/*.po
)
17 MO_FILES
= $(patsubst po
/%.po
,$(OUT
)/po
/%.mo
,$(PO_FILES
))
18 LINGUAS
= $(patsubst po
/%.po
,%,$(PO_FILES
))
20 $(OUT
)/po
/cpp.pot
: $(GETTEXT_SOURCES
) |
$(OUT
)/po
/dirstamp
22 $(Q
)$(XGETTEXT
) --default-domain
=$(GETTEXT_PACKAGE
) \
23 --add-comments
--keyword
=_
--keyword
=N_ \
27 --flag
=N_
:1:no-c-format \
28 --flag
=C_
:2:no-c-format \
29 --flag
=NC_
:2:no-c-format \
34 $(OUT
)/po
/xml.pot
: $(GETTEXT_DIALOGS
) |
$(OUT
)/po
/dirstamp
36 $(Q
)$(PERL
) $(topdir
)/tools
/xml2po.pl
$^
>$@.tmp
39 $(OUT
)/po
/event.pot
: $(GETTEXT_EVENTS
) |
$(OUT
)/po
/dirstamp
41 $(Q
)$(PERL
) $(topdir
)/tools
/xci2po.pl
$^
>$@.tmp
44 po
/$(GETTEXT_PACKAGE
).pot
: $(OUT
)/po
/cpp.pot
$(OUT
)/po
/xml.pot
$(OUT
)/po
/event.pot
46 $(Q
)$(MSGCAT
) -o
$@
$^
50 update-po
: po
/$(GETTEXT_PACKAGE
).pot
51 $(Q
)for i in
$(PO_FILES
); do
$(MSGMERGE
) -o
$$i $$i po
/$(GETTEXT_PACKAGE
).pot
; done
53 $(MO_FILES
): $(OUT
)/po
/%.mo
: po
/%.po |
$(OUT
)/po
/dirstamp
55 $(Q
)$(MSGFMT
) --check -o
$@
$<