crashrep/CustomTarget_crashrep_res.mk    |   12 +++++-------
 instsetoo_native/CustomTarget_install.mk |   23 +++++++----------------
 setup_native/CustomTarget_mac.mk         |   18 +++++-------------
 shell/CustomTarget_shlxthdl_res.mk       |   12 +++++-------
 solenv/gbuild/CustomTarget.mk            |   27 +++++++++++++++++++++++++++
 solenv/gbuild/Gallery.mk                 |   23 ++++++-----------------
 solenv/gbuild/InstallModuleTarget.mk     |   21 ++++-----------------
 sysui/CustomTarget_infoplist.mk          |    9 ++++++++-
 sysui/CustomTarget_share.mk              |   17 +++++------------
 sysui/Module_sysui.mk                    |    2 --
 10 files changed, 72 insertions(+), 92 deletions(-)

New commits:
commit 85c7e212a26b24883b9a001b6529efeb80955809
Author: Michael Stahl <[email protected]>
Date:   Tue Jul 16 14:54:04 2013 +0200

    gbuild: consolidate ULF copypaste in gb_CustomTarget_ulfex_rule
    
    Change-Id: I0c5b68f6bc81c7c1c88be2cde42fc06949fff8e7

diff --git a/crashrep/CustomTarget_crashrep_res.mk 
b/crashrep/CustomTarget_crashrep_res.mk
index be6c688..46d1016 100644
--- a/crashrep/CustomTarget_crashrep_res.mk
+++ b/crashrep/CustomTarget_crashrep_res.mk
@@ -33,12 +33,10 @@ $(call 
gb_CustomTarget_get_workdir,crashrep/source/win32)/crashrep_impl.rc :
                        -rch rcheader.txt \
                        -rcf rcfooter.txt)
 
-$(call gb_CustomTarget_get_workdir,crashrep/source/win32)/crashrep.ulf : \
-               $(SRCDIR)/crashrep/source/win32/crashrep.ulf \
-               $(call gb_Executable_get_runtime_dependencies,ulfex)
-       MERGEINPUT=`$(gb_MKTEMP)` && \
-       echo $(foreach 
lang,$(gb_TRANS_LANGS),$(gb_POLOCATION)/$(lang)/$(patsubst %/,%,$(subst 
$(SRCDIR)/,,$(dir $<))).po) > $${MERGEINPUT} && \
-       $(call gb_Executable_get_command,ulfex) -i $< -o $@ -m $${MERGEINPUT} 
-l all && \
-       rm -f $${MERGEINPUT}
+$(eval $(call gb_CustomTarget_ulfex_rule,\
+       $(call gb_CustomTarget_get_workdir,crashrep/source/win32)/crashrep.ulf,\
+       $(SRCDIR)/crashrep/source/win32/crashrep.ulf,\
+       $(foreach lang,$(gb_TRANS_LANGS),\
+               $(gb_POLOCATION)/$(lang)/crashrep/source/win32.po)))
 
 # vim: set shiftwidth=4 tabstop=4 noexpandtab:
diff --git a/instsetoo_native/CustomTarget_install.mk 
b/instsetoo_native/CustomTarget_install.mk
index 573b9c6..e3a52f2 100644
--- a/instsetoo_native/CustomTarget_install.mk
+++ b/instsetoo_native/CustomTarget_install.mk
@@ -35,23 +35,14 @@ $(call 
gb_CustomTarget_get_workdir,instsetoo_native/install)/bin/find-requires-%
        cat $< | tr -d "\015" > $@
        chmod a+x $@
 
-ifneq ($(WITH_LANG),)
 $(call 
gb_CustomTarget_get_workdir,instsetoo_native/install)/win_ulffiles/%.ulf: \
-               
$(SRCDIR)/instsetoo_native/inc_openoffice/windows/msi_languages/%.ulf | \
-               $(call gb_Executable_get_runtime_dependencies,ulfex) \
-               $(call gb_Postprocess_get_target,AllModulesButInstsetNative)
-       $(call gb_Output_announce,$@,$(true),SUM,1)
-       MERGEINPUT=`$(gb_MKTEMP)` && \
-       echo $(foreach 
lang,$(gb_TRANS_LANGS),$(gb_POLOCATION)/$(lang)/instsetoo_native/inc_openoffice/windows/msi_languages.po)
 > $${MERGEINPUT} && \
-       $(call gb_Helper_abbreviate_dirs,\
-       $(call gb_Executable_get_command,ulfex) -i $< -o $@ -m $${MERGEINPUT} 
-l all ) && \
-       rm -rf $${MERGEINPUT}
-else
-$(call 
gb_CustomTarget_get_workdir,instsetoo_native/install)/win_ulffiles/%.ulf: \
-               
$(SRCDIR)/instsetoo_native/inc_openoffice/windows/msi_languages/%.ulf \
-               $(call gb_Postprocess_get_target,AllModulesButInstsetNative)
-       cp $< $@
-endif
+               | $(call gb_Postprocess_get_target,AllModulesButInstsetNative)
+
+$(eval $(call gb_CustomTarget_ulfex_rule,\
+       $(call 
gb_CustomTarget_get_workdir,instsetoo_native/install)/win_ulffiles/%.ulf,\
+       $(SRCDIR)/instsetoo_native/inc_openoffice/windows/msi_languages/%.ulf,\
+       $(foreach lang,$(gb_TRANS_LANGS),\
+               
$(gb_POLOCATION)/$(lang)/instsetoo_native/inc_openoffice/windows/msi_languages.po)))
 
 export ENABLE_DOWNLOADSETS ?= TRUE
 ifeq ($(OS),LINUX)
diff --git a/setup_native/CustomTarget_mac.mk b/setup_native/CustomTarget_mac.mk
index d3b171b..2f35f23 100644
--- a/setup_native/CustomTarget_mac.mk
+++ b/setup_native/CustomTarget_mac.mk
@@ -11,18 +11,10 @@ $(eval $(call 
gb_CustomTarget_CustomTarget,setup_native/mac))
 
 $(eval $(call gb_CustomTarget_register_target,setup_native/mac,macinstall.ulf))
 
-#FIXME: generalize rule? ripped off from ScpMergeTarget
-ifneq ($(WITH_LANG),)
-$(call gb_CustomTarget_get_workdir,setup_native/mac)/macinstall.ulf: 
$(SRCDIR)/setup_native/source/mac/macinstall.ulf | $(call 
gb_Executable_get_runtime_dependencies,ulfex)
-       $(call gb_Output_announce,$@,$(true),SUM,1)
-       MERGEINPUT=`$(gb_MKTEMP)` && \
-       echo $(foreach 
lang,$(gb_TRANS_LANGS),$(gb_POLOCATION)/$(lang)/setup_native/source/mac.po) > 
$${MERGEINPUT} && \
-       $(call gb_Helper_abbreviate_dirs,\
-       $(call gb_Executable_get_command,ulfex) -i $< -o $@ -m $${MERGEINPUT} 
-l all ) && \
-       rm -rf $${MERGEINPUT}
-else
-$(call gb_CustomTarget_get_workdir,setup_native/mac)/macinstall.ulf: 
$(SRCDIR)/setup_native/source/mac/macinstall.ulf
-       cp $< $@
-endif
+$(eval $(call gb_CustomTarget_ulfex_rule,\
+       $(call gb_CustomTarget_get_workdir,setup_native/mac)/macinstall.ulf,\
+       $(SRCDIR)/setup_native/source/mac/macinstall.ulf,\
+       $(foreach lang,$(gb_TRANS_LANGS),\
+               $(gb_POLOCATION)/$(lang)/setup_native/source/mac.po)))
 
 # vim: set noet sw=4 ts=4:
diff --git a/shell/CustomTarget_shlxthdl_res.mk 
b/shell/CustomTarget_shlxthdl_res.mk
index 6df6008..025dc91 100644
--- a/shell/CustomTarget_shlxthdl_res.mk
+++ b/shell/CustomTarget_shlxthdl_res.mk
@@ -31,12 +31,10 @@ $(call 
gb_CustomTarget_get_workdir,shell/source/win32/shlxthandler/res)/shlxthdl
                        -rch rcheader.txt \
                        -rcf rcfooter.txt)
 
-$(call 
gb_CustomTarget_get_workdir,shell/source/win32/shlxthandler/res)/shlxthdl.ulf : 
\
-               $(SRCDIR)/shell/source/win32/shlxthandler/res/shlxthdl.ulf \
-               $(call gb_Executable_get_runtime_dependencies,ulfex)
-       MERGEINPUT=`$(gb_MKTEMP)` && \
-       echo $(foreach 
lang,$(gb_TRANS_LANGS),$(gb_POLOCATION)/$(lang)/$(patsubst %/,%,$(subst 
$(SRCDIR)/,,$(dir $<))).po) > $${MERGEINPUT} && \
-       $(call gb_Executable_get_command,ulfex) -i $< -o $@ -m $${MERGEINPUT} 
-l all && \
-       rm -f $${MERGEINPUT}
+$(eval $(call gb_CustomTarget_ulfex_rule,\
+       $(call 
gb_CustomTarget_get_workdir,shell/source/win32/shlxthandler/res)/shlxthdl.ulf,\
+       $(SRCDIR)/shell/source/win32/shlxthandler/res/shlxthdl.ulf,\
+       $(foreach lang,$(gb_TRANS_LANGS),\
+               
$(gb_POLOCATION)/$(lang)/shell/source/win32/shlxthandler/res.po)))
 
 # vim: set shiftwidth=4 tabstop=4 noexpandtab:
diff --git a/solenv/gbuild/CustomTarget.mk b/solenv/gbuild/CustomTarget.mk
index f2ee657..3f6357e 100644
--- a/solenv/gbuild/CustomTarget.mk
+++ b/solenv/gbuild/CustomTarget.mk
@@ -50,4 +50,31 @@ $(foreach target,$(2),$(call 
gb_CustomTarget_register_target,$(1),$(target)))
 
 endef
 
+ifneq ($(WITH_LANG),)
+
+# $(call gb_CustomTarget_ulfex__command,ulftarget,ulfsource,pofiles)
+define gb_CustomTarget_ulfex__command
+$(call gb_Output_announce,$(1),$(true),ULF,1)
+MERGEINPUT=`$(gb_MKTEMP)` && \
+echo $(3) > $${MERGEINPUT} && \
+$(call gb_Helper_abbreviate_dirs,\
+       $(call gb_Executable_get_command,ulfex) -i $(2) -o $(1) -m 
$${MERGEINPUT} -l all) && \
+rm -rf $${MERGEINPUT}
+endef
+
+else
+
+define gb_CustomTarget_ulfex__command
+cp $(2) $(1)
+endef
+
+endif
+
+# $(call gb_CustomTarget_ulfex_rule,ulftargetpattern,ulfsource,pofiles)
+define gb_CustomTarget_ulfex_rule
+$(1) : $(2) $(if $(WITH_LANG),$(call 
gb_Executable_get_runtime_dependencies,ulfex))
+       $$(call gb_CustomTarget_ulfex__command,$$@,$(subst %,$$*,$(strip 
$(2))),$(strip $(3)))
+
+endef
+
 # vim: set noet sw=4:
diff --git a/solenv/gbuild/Gallery.mk b/solenv/gbuild/Gallery.mk
index 928ba92..113f59b 100644
--- a/solenv/gbuild/Gallery.mk
+++ b/solenv/gbuild/Gallery.mk
@@ -78,15 +78,6 @@ $(call gb_Helper_abbreviate_dirs,\
 )
 endef
 
-define gb_Gallery__command_ulf
-$(call gb_Output_announce,$(2),$(true),ULF,1)
-MERGEINPUT=`$(gb_MKTEMP)` && \
-echo $(foreach 
lang,$(gb_TRANS_LANGS),$(gb_POLOCATION)/$(lang)/extras/source/gallery/share.po) 
> $${MERGEINPUT} && \
-$(call gb_Helper_abbreviate_dirs,\
-       $(call gb_Executable_get_command,ulfex) -i $(GALLERY_ULFFILE) -o $(1) 
-m $${MERGEINPUT} -l all) && \
-rm -rf $${MERGEINPUT}
-endef
-
 define gb_Gallery__command_str
 $(call gb_Output_announce,$(2),$(true),STR,1)
 cp -f $(GALLERY_STRFILE) $@ && \
@@ -112,14 +103,12 @@ $(call gb_Gallery_get_target,%) : \
 $(call gb_Gallery__get_final_target,%) :
        touch $@
 
-ifneq ($(WITH_LANG),)
-$(call gb_Gallery_get_workdir,%).ulf : $(call 
gb_Executable_get_runtime_dependencies,ulfex)
-       $(call gb_Gallery__command_ulf,$@,$*)
-else
-$(call gb_Gallery_get_workdir,%).ulf :
-       $(call gb_Output_announce,$*,$(true),CPY,1)
-       cp $(GALLERY_ULFFILE) $@
-endif
+# difficult to determine source dep for this one...
+$(call gb_Gallery_get_workdir,%).ulf : \
+               $(call gb_Executable_get_runtime_dependencies,ulfex)
+       $(call gb_CustomTarget_ulfex__command,$@,$(GALLERY_ULFFILE),\
+               $(foreach lang,$(gb_TRANS_LANGS),\
+                       
$(gb_POLOCATION)/$(lang)/extras/source/gallery/share.po))
 
 $(call gb_Gallery_get_workdir,%).str : $(gb_Gallery_TRANSLATE)
        $(call gb_Gallery__command_str,$@,$*)
diff --git a/solenv/gbuild/InstallModuleTarget.mk 
b/solenv/gbuild/InstallModuleTarget.mk
index d4cf4c9..d7c74d7 100644
--- a/solenv/gbuild/InstallModuleTarget.mk
+++ b/solenv/gbuild/InstallModuleTarget.mk
@@ -97,26 +97,15 @@ endef
 
 # ScpMergeTarget class
 
-gb_ScpMergeTarget_DEPS := $(call gb_Executable_get_runtime_dependencies,ulfex)
-gb_ScpMergeTarget_COMMAND := $(call gb_Executable_get_command,ulfex)
-
 gb_ScpMergeTarget_get_source = $(SRCDIR)/$(1).ulf
 
-define gb_ScpMergeTarget__command
-$(call gb_Output_announce,$(2),$(true),SUM,1)
-MERGEINPUT=`$(gb_MKTEMP)` && \
-echo $(SCP_POFILES) > $${MERGEINPUT} && \
-$(call gb_Helper_abbreviate_dirs,\
-       $(gb_ScpMergeTarget_COMMAND) -i $(SCP_SOURCE) -o $(1) -m $${MERGEINPUT} 
-l all ) && \
-rm -rf $${MERGEINPUT}
-
-endef
-
 $(dir $(call gb_ScpMergeTarget_get_target,%))%/.dir :
        $(if $(wildcard $(dir $@)),,mkdir -p $(dir $@))
 
-$(call gb_ScpMergeTarget_get_target,%) : $(gb_ScpMergeTarget_DEPS)
-       $(call gb_ScpMergeTarget__command,$@,$*)
+$(eval $(call gb_CustomTarget_ulfex_rule,\
+       $(call gb_ScpMergeTarget_get_target,%),\
+       $(call gb_ScpMergeTarget_get_source,%),\
+       $$(SCP_POFILES)))
 
 .PHONY : $(call gb_ScpMergeTarget_get_clean_target,%)
 $(call gb_ScpMergeTarget_get_clean_target,%) :
@@ -125,8 +114,6 @@ $(call gb_ScpMergeTarget_get_clean_target,%) :
 
 # gb_ScpMergeTarget_ScpMergeTarget(<target>)
 define gb_ScpMergeTarget_ScpMergeTarget
-$(call gb_ScpMergeTarget_get_target,$(1)) : SCP_SOURCE := $(call 
gb_ScpMergeTarget_get_source,$(1))
-$(call gb_ScpMergeTarget_get_target,$(1)) : $(call 
gb_ScpMergeTarget_get_source,$(1))
 $(call gb_ScpMergeTarget_get_target,$(1)) :| $(dir $(call 
gb_ScpMergeTarget_get_target,$(1))).dir
 $(call gb_ScpMergeTarget_get_target,$(1)) : \
        SCP_POFILES := $(foreach 
lang,$(gb_TRANS_LANGS),$(gb_POLOCATION)/$(lang)/$(patsubst %/,%,$(dir $(1))).po)
diff --git a/sysui/CustomTarget_infoplist.mk b/sysui/CustomTarget_infoplist.mk
index 64419ba..48e8cc8 100644
--- a/sysui/CustomTarget_infoplist.mk
+++ b/sysui/CustomTarget_infoplist.mk
@@ -31,10 +31,17 @@ $(info_WORKDIR)/InfoPlist_%.zip: 
$(info_WORKDIR)/InfoPlist_%/InfoPlist.strings
        $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),ZIP,1)
        zip -j $@ $<
 
-$(info_WORKDIR)/InfoPlist_%/InfoPlist.strings: $(info_WORKDIR)/Info.plist 
$(call gb_CustomTarget_get_workdir,sysui/share)/documents.ulf
+$(info_WORKDIR)/InfoPlist_%/InfoPlist.strings: \
+               $(info_WORKDIR)/Info.plist $(info_WORKDIR)/documents.ulf
        mkdir -p $(dir $@)
        $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),PRL,1)
        $(PERL) -w $(info_SRCDIR)/gen_strings.pl -l $* -p $^ | \
        iconv -f UTF-8 -t UTF-16 >$@
 
+$(eval $(call gb_CustomTarget_ulfex_rule,\
+       $(info_WORKDIR)/documents.ulf,\
+       $(SRCDIR)/sysui/desktop/share/documents.ulf,\
+       $(foreach lang,$(gb_TRANS_LANGS),\
+               $(gb_POLOCATION)/$(lang)/sysui/desktop/share.po)))
+
 # vim: set noet sw=4 ts=4:
diff --git a/sysui/CustomTarget_share.mk b/sysui/CustomTarget_share.mk
index e342cfa..2783995 100644
--- a/sysui/CustomTarget_share.mk
+++ b/sysui/CustomTarget_share.mk
@@ -212,17 +212,10 @@ $(share_WORKDIR)/%/build.flag: 
$(share_SRCDIR)/share/brand.pl $(LAUNCHERS) \
                --ext "desktop" --key "UnityQuickList" 
$(share_WORKDIR)/launcher_unityquicklist.ulf
        touch $@
 
-ifneq ($(WITH_LANG),)
-$(share_WORKDIR)/%.ulf: $(share_SRCDIR)/share/%.ulf | $(call 
gb_Executable_get_runtime_dependencies,ulfex)
-       $(call gb_Output_announce,$@,$(true),SUM,1)
-       MERGEINPUT=`$(gb_MKTEMP)` && \
-       echo $(foreach 
lang,$(gb_TRANS_LANGS),$(gb_POLOCATION)/$(lang)/sysui/desktop/share.po) > 
$${MERGEINPUT} && \
-       $(call gb_Helper_abbreviate_dirs,\
-       $(call gb_Executable_get_command,ulfex) -i $< -o $@ -m $${MERGEINPUT} 
-l all ) && \
-       rm -rf $${MERGEINPUT}
-else
-$(share_WORKDIR)/%.ulf: $(share_SRCDIR)/share/%.ulf
-       cp $< $@
-endif
+$(eval $(call gb_CustomTarget_ulfex_rule,\
+       $(share_WORKDIR)/%.ulf,\
+       $(share_SRCDIR)/share/%.ulf,\
+       $(foreach lang,$(gb_TRANS_LANGS),\
+               $(gb_POLOCATION)/$(lang)/sysui/desktop/share.po)))
 
 # vim: set noet sw=4 ts=4:
diff --git a/sysui/Module_sysui.mk b/sysui/Module_sysui.mk
index 56bd523..62fb208 100644
--- a/sysui/Module_sysui.mk
+++ b/sysui/Module_sysui.mk
@@ -22,9 +22,7 @@ $(eval $(call gb_Module_add_targets,sysui,\
 ))
 
 else # OS=MACOSX
-# CustomTarget_share builds documents.ulf which is needed in infoplist...
 $(eval $(call gb_Module_add_targets,sysui,\
-       CustomTarget_share \
        Package_osxicons \
        CustomTarget_infoplist \
        Package_infoplist \
_______________________________________________
Libreoffice-commits mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to