Reworked LocaleRules (again). The generated catkeys and catalogs are stored in

a directory structure that reflects the catalogs in the repository. DoCatalogs
accepts an optional folder parameter, which allows one to specify an additional
subfolder to glob *.catkeys from. For example dstcheck in src/bin.
Improves upon r38819 and should address the concerns in
http://www.freelists.org/post/haiku/BOM-providing-catkeyszip-and-catkeyszipmd5-again,1


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38873 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Matt Madia
2010-10-03 15:21:59 +00:00
parent 9836c9403a
commit ab17e86a66
2 changed files with 20 additions and 8 deletions
+15 -6
View File
@@ -57,8 +57,10 @@ rule ExtractCatalogEntries target : sources : signature : regexp
SEARCH on $(sources) += $(SEARCH_SOURCE) ; SEARCH on $(sources) += $(SEARCH_SOURCE) ;
local subdir
= [ on $(signature) return $(HAIKU_CATALOGS_SUBDIR) ] ;
MakeLocate $(target) MakeLocate $(target)
: [ FDirName $(HAIKU_CATALOGS_OBJECT_DIR) $(signature) ] ; : [ FDirName $(HAIKU_CATALOGS_OBJECT_DIR) $(subdir) ] ;
Depends $(target) : $(sources) <build>collectcatkeys ; Depends $(target) : $(sources) <build>collectcatkeys ;
LocalClean clean : $(target).pre ; LocalClean clean : $(target).pre ;
ExtractCatalogEntries1 $(target) : <build>collectcatkeys $(sources) ; ExtractCatalogEntries1 $(target) : <build>collectcatkeys $(sources) ;
@@ -80,8 +82,10 @@ rule LinkApplicationCatalog target : sources : signature : language
# if the fingerprint matches the one from the untranslated catalog for the # if the fingerprint matches the one from the untranslated catalog for the
# same file. # same file.
local subdir
= [ on $(signature) return $(HAIKU_CATALOGS_SUBDIR) ] ;
MakeLocate $(target) MakeLocate $(target)
: [ FDirName $(HAIKU_CATALOGS_OBJECT_DIR) $(signature) ] ; : [ FDirName $(HAIKU_CATALOGS_OBJECT_DIR) $(subdir) ] ;
Depends $(target) : $(sources) <build>linkcatkeys ; Depends $(target) : $(sources) <build>linkcatkeys ;
LocalClean clean : $(target) ; LocalClean clean : $(target) ;
@@ -97,10 +101,10 @@ actions LinkApplicationCatalog1
-s $(HAIKU_CATALOG_SIGNATURE) -o "$(1)" -s $(HAIKU_CATALOG_SIGNATURE) -o "$(1)"
} }
rule DoCatalogs target : signature : sources : sourceLanguage : regexp rule DoCatalogs target : signature : sources : sourceLanguage : regexp : subdir
{ {
# DoCatalogs <target> : <signature> : <sources> [ : <sourceLanguage> ] # DoCatalogs <target> : <signature> : <sources> [ : <sourceLanguage> ]
# [ : <regexp> ] # [ : <regexp> ] [ : <folder> ]
# #
# Extracts the catkeys from a target's source files, generates the # Extracts the catkeys from a target's source files, generates the
# default catalog from them, and also generates catalogs for all # default catalog from them, and also generates catalogs for all
@@ -114,11 +118,16 @@ rule DoCatalogs target : signature : sources : sourceLanguage : regexp
# the sources. Optional: default is "en". # the sources. Optional: default is "en".
# regexp The regular expression used to parse the files. # regexp The regular expression used to parse the files.
# Optional: default is matching be_catalog->GetString # Optional: default is matching be_catalog->GetString
# folder Optional: the subdirectory containing *.catkeys
local subdir = $(SUBDIR_TOKENS[2-]) $(folder) ;
HAIKU_CATALOGS_SUBDIR on $(signature) = $(subdir) ;
local generatedCatalog local generatedCatalog
= [ FGristFiles $(sourceLanguage:E=en:S=.catalog) ] ; = [ FGristFiles $(sourceLanguage:E=en:S=.catalog) ] ;
MakeLocate $(generatedCatalog) MakeLocate $(generatedCatalog)
: [ FDirName $(HAIKU_CATALOGS_OBJECT_DIR) $(signature) ] ; : [ FDirName $(HAIKU_CATALOGS_OBJECT_DIR) $(subdir) ] ;
# generate catkeys file from sources # generate catkeys file from sources
ExtractCatalogEntries $(generatedCatalog:S=.catkeys) ExtractCatalogEntries $(generatedCatalog:S=.catkeys)
@@ -126,7 +135,7 @@ rule DoCatalogs target : signature : sources : sourceLanguage : regexp
# find translations # find translations
local translationsDir local translationsDir
= [ FDirName $(HAIKU_TOP) data catalogs $(SUBDIR_TOKENS[2-]) ] ; = [ FDirName $(HAIKU_TOP) data catalogs $(folder) ] ;
local translations = [ Glob $(translationsDir) : *.catkeys ] ; local translations = [ Glob $(translationsDir) : *.catkeys ] ;
translations = [ FGristFiles $(translations:BS) ] ; translations = [ FGristFiles $(translations:BS) ] ;
SEARCH on $(translations) += $(translationsDir) ; SEARCH on $(translations) += $(translationsDir) ;
+5 -2
View File
@@ -215,9 +215,12 @@ StdBinCommands
: libncurses.a : $(haiku-utils_rsrc) ; : libncurses.a : $(haiku-utils_rsrc) ;
# Localization of some applications # Localization of some applications
DoCatalogs dstcheck : DoCatalogs dstcheck
x-vnd.Haiku-cmd-dstconfig : x-vnd.Haiku-cmd-dstconfig
: dstcheck.cpp : dstcheck.cpp
:
:
: dstcheck
; ;
SubInclude HAIKU_TOP src bin addattr ; SubInclude HAIKU_TOP src bin addattr ;