summaryrefslogtreecommitdiff
path: root/solenv
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2011-12-22 10:08:06 +0100
committerDavid Tardon <dtardon@redhat.com>2011-12-22 13:28:58 +0100
commita6511b9d9a3f13835510a9caffc837829b206d14 (patch)
tree990e5e685373e3a90d15ba15d031b685523506e7 /solenv
parentbc3683aecd2205db8878c87d028550ef7b07203e (diff)
add some explanation for gb_SrsTemplateTarget
Diffstat (limited to 'solenv')
-rw-r--r--solenv/gbuild/AllLangResTarget.mk22
1 files changed, 22 insertions, 0 deletions
diff --git a/solenv/gbuild/AllLangResTarget.mk b/solenv/gbuild/AllLangResTarget.mk
index 4600999e6abf..1329f2aa5f25 100644
--- a/solenv/gbuild/AllLangResTarget.mk
+++ b/solenv/gbuild/AllLangResTarget.mk
@@ -133,6 +133,19 @@ endif
endef
# SrsTemplateTarget class
+#
+# This class handles src templates.
+#
+# Templates are src files that contain only macros that are then used
+# from other src files, but these macros contain translatable strings.
+# Because the processing of src files is done in two phases: 1/
+# localization and 2/ merging, templates must be translated
+# independently from the src files that include them. Special care must
+# be taken to ensure that the right file (i.e., the localized one) is
+# included; in order to do that, the templates in the source tree are
+# called foo_tmpl.src, but the localization phase produces foo.src, and
+# these names (i.e., without the _tmpl suffix) must be placed in
+# #include statements in other src files.
define gb_SrsTemplateTarget__command
$(call gb_Helper_abbreviate_dirs,\
@@ -140,6 +153,15 @@ define gb_SrsTemplateTarget__command
touch $(1))
endef
+# This machinery ensures that templates are regenerated when switching
+# from localized to unlocalized configuration and back.
+#
+# How it works:
+# We let _get_target depend on _get_update_target, so after they are
+# done, _get_target is newer than _get_update_target. If
+# WITH_LANG changes (from nonempty to empty or the other way around),
+# _get_target and _get_update_target are switched, therefore _get_target
+# is now _older_ than _get_update_target and must be regenerated :-)
gb_SrsTemplateTarget__get_merged_target = $(call gb_SrsTemplateTarget_get_target,$(1))_merged_last
gb_SrsTemplateTarget__get_unmerged_target = $(call gb_SrsTemplateTarget_get_target,$(1))_unmerged_last