diff options
-rw-r--r-- | RepositoryExternal.mk | 14 | ||||
-rw-r--r-- | extras/Gallery_test.mk | 11 | ||||
-rw-r--r-- | solenv/gbuild/Gallery.mk | 208 | ||||
-rw-r--r-- | solenv/gbuild/TargetLocations.mk | 2 | ||||
-rw-r--r-- | solenv/gbuild/extensions/pre_BuildTools.mk | 1 |
5 files changed, 145 insertions, 91 deletions
diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk index 5dbf31e23c5a..ebf8a55a63fd 100644 --- a/RepositoryExternal.mk +++ b/RepositoryExternal.mk @@ -2860,6 +2860,20 @@ $(call gb_Executable_add_runtime_dependencies,climaker,\ ) endef +define gb_Executable__register_gengal.bin +$(call gb_Executable_add_runtime_dependencies,gengal.bin,\ + $(call gb_AllLangResTarget_get_target,ofa) \ + $(call gb_Configuration_get_target,registry) \ + $(call gb_Configuration_get_target,fcfg_langpack) \ + $(call gb_Library_get_target,$(gb_CPPU_ENV)_uno) \ + $(call gb_Library_get_target,vclplug_svp) \ + $(call gb_Package_get_target_for_build,cppuhelper_unorc) \ + $(call gb_Rdb_get_outdir_target_for_build,ure/services) \ + $(call gb_UnoApi_get_target,offapi) \ + $(call gb_UnoApi_get_target,udkapi) \ +) +endef + ifneq ($(SYSTEM_ICU),YES) define gb_Executable__register_gendict diff --git a/extras/Gallery_test.mk b/extras/Gallery_test.mk index c82d03cc1f0c..67c8e91ff238 100644 --- a/extras/Gallery_test.mk +++ b/extras/Gallery_test.mk @@ -7,12 +7,13 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # -$(eval $(call gb_Gallery_Gallery,extras/source/gallery,gallery,Fun Gallery)) +$(eval $(call gb_Gallery_Gallery,test,extras/source/gallery,Fun Gallery)) -$(eval $(call gb_Gallery_add_files,extras/source/gallery, \ +$(eval $(call gb_Gallery_add_files,test,\ + extras/source/gallery/apples.gif \ extras/source/gallery/bigapple.gif \ - extras/source/gallery/sky.gif \ - extras/source/gallery/flower.gif \ - extras/source/gallery/apples.gif )) + extras/source/gallery/flower.gif \ + extras/source/gallery/sky.gif \ +)) # vim: set noet sw=4 ts=4: diff --git a/solenv/gbuild/Gallery.mk b/solenv/gbuild/Gallery.mk index 850862210fb2..eae9b680926b 100644 --- a/solenv/gbuild/Gallery.mk +++ b/solenv/gbuild/Gallery.mk @@ -7,116 +7,152 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # -.PHONY : $(call gb_Gallery_get_clean_target,%) -$(call gb_Gallery_get_clean_target,%) : - $(call gb_Helper_abbreviate_dirs,\ - rm -f $(call gb_Gallery_get_target,$*) $(call gb_Gallery_get_target,$*).log) +# class Gallery + +# Handles creation of image galleries. + +gb_Gallery__UNO_COMPONENTS := \ + comphelper/util/comphelp \ + configmgr/source/configmgr \ + fileaccess/source/fileacc \ + framework/util/fwk \ + i18npool/util/i18npool \ + package/source/xstor/xstor \ + package/util/package2 \ + sfx2/util/sfx \ + svx/util/svx \ + svx/util/svxcore \ + ucb/source/core/ucb1 \ + ucb/source/ucp/file/ucpfile1 \ + unoxml/source/service/unoxml + +gb_Gallery__UNO_TYPES := \ + offapi \ + udkapi + +# TODO: this should be in RepositoryExternal.mk, but it would lead to +# duplication. Fix. +gb_Gallery_EXTRA_DEPENCENCIES := \ + $(foreach component,$(gb_Gallery__UNO_COMPONENTS),$(call gb_ComponentTarget_get_outdir_target_for_build,$(component))) \ + $(foreach api,$(gb_Gallery__UNO_TYPES),$(call gb_UnoApi_get_target,$(api))) + +gb_Gallery_INSTDIR := share/gallery + +# BRAND_BASE_DIR is for resource files +define gb_Gallery__make_env_args +"-env:BRAND_BASE_DIR=$(call gb_Helper_make_url,$(OUTDIR_FOR_BUILD)/unittest/install)" \ +"-env:CONFIGURATION_LAYERS=xcsxcu:$(call gb_Helper_make_url,$(gb_Configuration_registry)) \ + module:$(call gb_Helper_make_url,$(gb_Configuration_registry)/spool)" \ +"-env:UNO_SERVICES=$(call gb_Helper_make_url,$(call gb_Rdb_get_outdir_target_for_build,ure/services)) \ + $(foreach item,$(gb_Gallery__UNO_COMPONENTS),\ + $(call gb_Helper_make_url,$(call gb_ComponentTarget_get_outdir_target_for_build,$(item))))" \ +"-env:UNO_TYPES=$(foreach item,$(gb_Gallery__UNO_TYPES),\ + $(call gb_Helper_make_url,$(call gb_UnoApi_get_target,$(item))))" \ +$(foreach dir,URE_INTERNAL_LIB_DIR LO_LIB_DIR,\ + -env:$(dir)=$(call gb_Helper_make_url,$(gb_Helper_OUTDIRLIBDIR))) +endef -.PHONY : $(call gb_Gallery_get_target,%) -$(call gb_Gallery_get_target,%) :| $(call gb_Gallery_get_target,$(1))/$(2).thm - @echo "foo" +define gb_Gallery__command +$(call gb_Output_announce,$(2),$(true),GAL,1) +$(call gb_Helper_abbreviate_dirs,\ + rm -f $(call gb_Gallery_get_workdir,$(2))/* && \ + SAL_USE_VCLPLUGIN=svp \ + $(call gb_Executable_get_command,gengal.bin) \ + $(call gb_Gallery__make_env_args) \ + --destdir $(GALLERY_BASEDIR) \ + --name "$(GALLERY_NAME)" \ + --path $(call gb_Gallery_get_workdir,$(2))) \ + $(GALLERY_FILES) && \ + touch $@ +endef +gb_Gallery__get_final_target = $(WORKDIR)/Gallery/$(1).final -define gb_Gallery_Gallery +$(dir $(call gb_Gallery_get_target,$(1))).dir : + $(if $(wildcard $(dir $@)),,mkdir -p $(dir $@)) -$(call gb_Gallery_get_target,$(1)) : CONFIGURATION_LAYERS := -$(call gb_Gallery_get_target,$(1)) : URE := $(false) -$(call gb_Gallery_get_target,$(1)) : UNO_SERVICES := -$(call gb_Gallery_get_target,$(1)) : UNO_TYPES := -$(call gb_Gallery_get_target,$(1)) : IMAGE_FILES := +$(dir $(call gb_Gallery_get_target,$(1)))%/.dir : + $(if $(wildcard $(dir $@)),,mkdir -p $(dir $@)) -$(call gb_Gallery_get_target,$(1)) :| $(dir $(call gb_Gallery_get_target,$(1))).dir +$(call gb_Gallery_get_target,%) : \ + $(call gb_Executable_get_runtime_dependencies,gengal.bin) \ + $(gb_Gallery_EXTRA_DEPENCENCIES) + $(call gb_Gallery__command,$@,$*) -$(dir $(call gb_Gallery_get_target,$(1))).dir : - mkdir -p $(dir $(call gb_Gallery_get_target,$(1))) - touch $(dir $(call gb_Gallery_get_target,$(1))).dir - -$(eval $(call gb_Module_register_target,$(call gb_Gallery_get_target,$(1)),$(call gb_Gallery_get_clean_target,$(1)))) -$(call gb_Helper_make_userfriendly_targets,$(1),Gallery) - -$(eval $(call gb_Gallery_use_components,$(1), \ - comphelper/util/comphelp \ - configmgr/source/configmgr \ - fileaccess/source/fileacc \ - i18npool/util/i18npool \ - package/source/xstor/xstor \ - package/util/package2 \ - sfx2/util/sfx \ - svx/util/svx \ - svx/util/svxcore \ - ucb/source/core/ucb1 \ - ucb/source/ucp/file/ucpfile1 \ - unoxml/source/service/unoxml \ -)) - -# setup URE -$(eval $(call gb_Gallery__use_configuration,$(1),xcsxcu,$(gb_Configuration_registry))) -$(eval $(call gb_Gallery__use_configuration,$(1),module,$(gb_Configuration_registry)/spool)) -$(eval $(call gb_Gallery__use_configuration,$(1)/,xcsxcu,$(OUTDIR)/unittest/registry)) -$(eval $(call gb_Gallery__use_api,$(1),udkapi)) -$(eval $(call gb_Gallery__use_api,$(1),offapi)) - -$(call gb_Gallery_get_target,$(1)) : \ - $(call gb_Gallery_get_target,$(1))/$(2).thm - -# main gallery build rule -$(call gb_Gallery_get_target,$(1))/$(2).thm : \ - $(call gb_Executable_get_runtime_dependencies,gengal) - $(call gb_Output_announce,building gallery: $*,$(true),MOD,1) - $(call gb_Helper_abbreviate_dirs, \ - $(call gb_Executable_get_command,gengal) \ - $(call gb_Gallery_make_args) \ - --name "$(3)" \ - --path $(call gb_Gallery_get_target,$(1))) \ - $(foreach item,$(IMAGE_FILES),$(item)) && \ - mv -f $(call gb_Gallery_get_target,$(1))/001.thm $(call gb_Gallery_get_target,$(1))/$(2).thm +$(call gb_Gallery__get_final_target,%) : + touch $@ -endef +.PHONY : $(call gb_Gallery_get_clean_target,%) +$(call gb_Gallery_get_clean_target,%) : + $(call gb_Output_announce,$*,$(false),GAL,1) + $(call gb_Helper_abbreviate_dirs,\ + rm -rf \ + $(call gb_Gallery__get_final_target,$*) \ + $(call gb_Gallery_get_target,$*) \ + $(call gb_Gallery_get_workdir,$*) \ + ) -# horrendous cut/paste from CppunitTest +$(WORKDIR)/Gallery/%.sdv : + touch $@ -define gb_Gallery_use_component -$(call gb_Gallery_get_target,$(1)) : \ - $(call gb_ComponentTarget_get_outdir_target,$(2)) -$(call gb_Gallery_get_target,$(1)) : \ - UNO_SERVICES += $(call gb_ComponentTarget_get_outdir_target,$(2)) +$(WORKDIR)/Gallery/%.thm : + touch $@ -endef +gb_Gallery_get_packagename = Gallery/$(1) -define gb_Gallery__use_api -$(call gb_Gallery_get_target,$(1)) : $(call gb_UnoApi_get_target,$(2)) -$(call gb_Gallery_get_target,$(1)) : UNO_TYPES += $(call gb_UnoApi_get_target,$(2)) +# Create a gallery. +# +# basedir will be stripped from paths of the files when they are +# inserted into the gallery. +# +# gb_Gallery_Gallery gallery basedir name +define gb_Gallery_Gallery +$(call gb_Gallery__Gallery_impl,$(1),$(call gb_Gallery_get_packagename,$(1)),$(2),$(3)) endef -define gb_Gallery__use_configuration -$(call gb_Gallery_get_target,$(1)) : CONFIGURATION_LAYERS += $(2):$(call gb_Helper_make_url,$(3)) +# gb_Gallery__Gallery_impl gallery package basedir name +define gb_Gallery__Gallery_impl +$(call gb_Package_Package_internal,$(2),$(call gb_Gallery_get_workdir,$(1))) +$(call gb_Package_set_outdir,$(2),$(INSTDIR)) +$(call gb_Package_add_file,$(2),$(gb_Gallery_INSTDIR)/$(1).sdv,sg1.sdv) +$(call gb_Package_add_file,$(2),$(gb_Gallery_INSTDIR)/$(1).thm,sg1.thm) -endef +$(call gb_Gallery_get_target,$(1)) : GALLERY_BASEDIR := $(SRCDIR)/$(3) +$(call gb_Gallery_get_target,$(1)) : GALLERY_FILES := +$(call gb_Gallery_get_target,$(1)) : GALLERY_NAME := $(4) -define gb_Gallery_use_components -$(foreach component,$(call gb_CppunitTest__filter_not_built_components,$(2)),$(call gb_Gallery_use_component,$(1),$(component))) +$(call gb_Gallery_get_workdir,$(1))/sg1.sdv \ +$(call gb_Gallery_get_workdir,$(1))/sg1.thm : $(call gb_Gallery_get_target,$(1)) +$(call gb_Gallery__get_final_target,$(1)) : $(call gb_Package_get_target,$(2)) +$(call gb_Gallery_get_clean_target,$(1)) : $(call gb_Package_get_clean_target,$(2)) +$(call gb_Gallery_get_target,$(1)) :| $(dir $(call gb_Gallery_get_target,$(1))).dir \ + $(call gb_Gallery_get_workdir,$(1))/.dir -endef +$$(eval $$(call gb_Module_register_target,$(call gb_Gallery__get_final_target,$(1)),$(call gb_Gallery_get_clean_target,$(1)))) +$(call gb_Helper_make_userfriendly_targets,$(1),Gallery,$(call gb_Gallery__get_final_target,$(1))) -define gb_Gallery_make_args - --build-tree \ - $(if $(strip $(UNO_SERVICES)),\ - "-env:UNO_SERVICES=$(foreach item,$(UNO_SERVICES),$(call gb_Helper_make_url,$(item)))") \ - $(if $(strip $(CONFIGURATION_LAYERS)),\ - "-env:CONFIGURATION_LAYERS=$(strip $(CONFIGURATION_LAYERS))") \ - $(if $(strip $(UNO_TYPES)),\ - "-env:UNO_TYPES=$(foreach item,$(UNO_TYPES),$(call gb_Helper_make_url,$(item)))") \ - $(foreach dir,URE_INTERNAL_LIB_DIR LO_LIB_DIR,\ - -env:$(dir)=$(call gb_Helper_make_url,$(gb_Helper_OUTDIRLIBDIR))) endef +# Add a file to the gallery. +# +# The file is given by path relative to $(SRCDIR). +# +# gb_Gallery_add_file gallery file define gb_Gallery_add_file -$(call gb_Gallery_get_target,$(1)) : IMAGE_FILES += $(call gb_Helper_make_url,$(2)) +$(call gb_Gallery_get_target,$(1)) : $(SRCDIR)/$(2) +$(call gb_Gallery_get_target,$(1)) : GALLERY_FILES += $(call gb_Helper_make_url,$(SRCDIR)/$(2)) + endef +# Add several files to the gallery at once. +# +# The files are given by path relative to $(SRCDIR). +# +# gb_Gallery_add_files gallery file(s) define gb_Gallery_add_files -$(foreach fname,$(2),$(call gb_Gallery__add_file,$(1),$(fname))) +$(foreach fname,$(2),$(call gb_Gallery_add_file,$(1),$(fname))) + endef # vim: set noet sw=4 ts=4: diff --git a/solenv/gbuild/TargetLocations.mk b/solenv/gbuild/TargetLocations.mk index 5497d57f7f7c..1757e84a82fd 100644 --- a/solenv/gbuild/TargetLocations.mk +++ b/solenv/gbuild/TargetLocations.mk @@ -32,6 +32,7 @@ gb_CliLibrary_get_target = $(gb_Helper_OUTDIRLIBDIR)/$(1)$(gb_CliLibrary_EXT) gb_CliNativeLibrary_get_target = $(gb_Helper_OUTDIRLIBDIR)/$(1)$(gb_CliNativeLibrary_EXT) gb_CliUnoApi_get_target = $(gb_Helper_OUTDIRLIBDIR)/$(1)$(gb_CliUnoApi_EXT) gb_ComponentTarget_get_outdir_target = $(OUTDIR)/xml/component/$(1).component +gb_ComponentTarget_get_outdir_target_for_build = $(OUTDIR_FOR_BUILD)/xml/component/$(1).component gb_Executable_get_target = $(OUTDIR)/bin/$(1)$(gb_Executable_EXT) gb_Executable_get_target_for_build = $(OUTDIR_FOR_BUILD)/bin/$(1)$(gb_Executable_EXT_for_build) gb_Extension_get_target = $(OUTDIR)/bin/$(1).oxt @@ -119,6 +120,7 @@ gb_ExternalProject_get_preparation_target = $(WORKDIR)/ExternalProject/$(1).prep gb_ExternalProject_get_state_target = $(WORKDIR)/ExternalProject/$(1)/$(2) gb_ExternalProject_get_target = $(WORKDIR)/ExternalProject/$(1).done gb_Gallery_get_target = $(WORKDIR)/Gallery/$(1).done +gb_Gallery_get_workdir = $(WORKDIR)/Gallery/$(1) gb_GeneratedPackage_get_target = $(WORKDIR)/GeneratedPackage/$(1).filelist gb_HelpIndexTarget_get_target = $(WORKDIR)/HelpIndexTarget/$(1).done gb_HelpJarTarget_get_target = $(WORKDIR)/HelpJarTarget/$(1).done diff --git a/solenv/gbuild/extensions/pre_BuildTools.mk b/solenv/gbuild/extensions/pre_BuildTools.mk index 5232573c5ee5..eea1bbb0f92e 100644 --- a/solenv/gbuild/extensions/pre_BuildTools.mk +++ b/solenv/gbuild/extensions/pre_BuildTools.mk @@ -38,6 +38,7 @@ gb_BUILD_TOOLS = \ ulfex \ xrmex \ $(call gb_Helper_optional_for_host,DESKTOP, \ + gengal.bin \ HelpIndexer \ HelpLinker \ ) \ |