Kaydet (Commit) 85c7e212 authored tarafından Michael Stahl's avatar Michael Stahl

gbuild: consolidate ULF copypaste in gb_CustomTarget_ulfex_rule

Change-Id: I0c5b68f6bc81c7c1c88be2cde42fc06949fff8e7
üst 2bbf5d5b
......@@ -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:
......@@ -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)
......
......@@ -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:
......@@ -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:
......@@ -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:
......@@ -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,$@,$*)
......
......@@ -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)
......
......@@ -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:
......@@ -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:
......@@ -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 \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment