diff options
author | David Tardon <dtardon@redhat.com> | 2013-04-11 12:25:07 +0200 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2013-04-13 09:26:17 +0200 |
commit | 8f0997c3a2af42d826f787ffb381ba82480c42be (patch) | |
tree | 0f36f3f83f38e2f41c5f67abef3ddb2b564eecdc /solenv | |
parent | b724a3bde9462ab4232da507680bb0f2a6d5d597 (diff) |
convert AllLangZip to install using Packages
... and also rename it to AllLangPackage.
Change-Id: I5bbc3847f2806221a5e3e4fa063ccc5a3b60a3fb
Diffstat (limited to 'solenv')
-rw-r--r-- | solenv/gbuild/AllLangPackage.mk | 110 | ||||
-rw-r--r-- | solenv/gbuild/AllLangZip.mk | 100 | ||||
-rw-r--r-- | solenv/gbuild/TargetLocations.mk | 4 | ||||
-rw-r--r-- | solenv/gbuild/gbuild.mk | 2 |
4 files changed, 113 insertions, 103 deletions
diff --git a/solenv/gbuild/AllLangPackage.mk b/solenv/gbuild/AllLangPackage.mk new file mode 100644 index 000000000000..531b1bb835ca --- /dev/null +++ b/solenv/gbuild/AllLangPackage.mk @@ -0,0 +1,110 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +# AllLangPackage class + +# Handles creation of a bunch of packages with content dependent on +# language. The package files are placed into $(INSTDIR). + +gb_AllLangPackage_LANGS := $(if $(strip $(gb_WITH_LANG)),$(gb_WITH_LANG),en-US) + +$(dir $(call gb_AllLangPackage_get_target,%)).dir : + $(if $(wildcard $(dir $@)),,mkdir -p $(dir $@)) + +$(call gb_AllLangPackage_get_target,%) : + $(call gb_Output_announce,$*,$(true),ALP,3) + touch $@ + +.PHONY : $(call gb_AllLangPackage_get_clean_target,%) +$(call gb_AllLangPackage_get_clean_target,%) : + $(call gb_Output_announce,$*,$(true),ALP,3) + rm -f $(call gb_AllLangPackage_get_target,$*) + +# Define a new package group. +# +# gb_AllLangPackage_AllLangPackage group srcdir +define gb_AllLangPackage_AllLangPackage +$(foreach lang,$(gb_AllLangPackage_LANGS),$(call gb_AllLangPackage__AllLangPackage_onelang,$(1),$(1)_$(lang),$(2))) + +$(call gb_AllLangPackage_get_target,$(1)) :| $(dir $(call gb_AllLangPackage_get_target,$(1))).dir + +$$(eval $$(call gb_Module_register_target,$(call gb_AllLangPackage_get_target,$(1)),$(call gb_AllLangPackage_get_clean_target,$(1)))) +$(call gb_Helper_make_userfriendly_targets,$(1),AllLangPackage) + +endef + +# Define a package for one lang. +# +# gb_AllLangPackage__AllLangPackage_lang group package srcdir +define gb_AllLangPackage__AllLangPackage_onelang +$(call gb_Package_Package_internal,$(2),$(3)) +$(call gb_Package_set_outdir,$(2),$(INSTDIR)) + +endef + +# gb_AllLangPackage__add_to_package target package destination source +define gb_AllLangPackage__add_to_package +$(call gb_Package_add_file,$(2),$(3),$(4)) +$(call gb_AllLangPackage_get_target,$(1)) : $(call gb_Package_get_target,$(2)) +$(call gb_AllLangPackage_get_clean_target,$(1)) : $(call gb_Package_get_clean_target,$(2)) + +endef + +# gb_AllLangPackage__add_file target destination source lang +define gb_AllLangPackage__add_file +$(if $(filter $(4),$(gb_AllLangPackage_LANGS)),$(call gb_AllLangPackage__add_to_package,$(1),$(1)_$(4),$(2),$(3))) + +endef + +# Add a file to one of the child packages. +# +# The language is taken from the first component of the file name. The +# file is only added if there is a package defined for the language +# (i.e., if we are building with the language). +# +# gb_AllLangPackage_add_file target destination source +define gb_AllLangPackage_add_file +$(call gb_AllLangPackage__add_file,$(1),$(2),$(3),$(firstword $(subst /, ,$(3)))) + +endef + +# Add several files to the child packages at once. +# +# gb_AllLangPackage_add_files target destination-dir file(s) +define gb_AllLangPackage_add_files +$(if $(strip $(2)),,$(call gb_Output_error,gb_AllLangPackage_add_files: destination dir cannot be empty)) +$(foreach file,$(3),$(call gb_AllLangPackage_add_file,$(1),$(2)/$(file),$(file))) + +endef + +# Add several files to the child packages at once. +# +# The files are placed into subdir under the language-dependent path. +# +# Example: +# $(eval $(call # gb_AllLangPackage_add_files_with_subdir,foo,destdir,subdir,cs/file.ext)) +# # -> destdir/cs/subdir/file.ext +# +# gb_AllLangPackage_add_files_with_subdir target destination-dir subdir file(s) +define gb_AllLangPackage_add_files_with_subdir +$(if $(strip $(2)),,$(call gb_Output_error,gb_AllLangPackage_add_files_with_subdir: destination dir cannot be empty)) +$(if $(strip $(3)),,$(call gb_Output_error,gb_AllLangPackage_add_files_with_subdir: there is no subdir, just use gb_AllLangPackage_add_files)) +$(foreach file,$(4),$(call gb_AllLangPackage_add_file,$(1),$(2)/$(dir $(file))$(3)/$(notdir $(file)),$(file))) + +endef + +# Use unpacked tarball. +# +# gb_AllLangPackage_add_dependency target unpacked +define gb_AllLangPackage_use_unpacked +$(foreach lang,$(gb_AllLangPackage_LANGS),$(call gb_Package_use_unpacked,$(1)_$(lang),$(2))) + +endef + +# vim: set noet sw=4 ts=4: diff --git a/solenv/gbuild/AllLangZip.mk b/solenv/gbuild/AllLangZip.mk deleted file mode 100644 index c02ddf18e500..000000000000 --- a/solenv/gbuild/AllLangZip.mk +++ /dev/null @@ -1,100 +0,0 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- -# -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# - -# AllLangZip class - -# Handles creation of a bunch of zip files with content dependent on -# language - -gb_AllLangZip_LANGS := $(if $(strip $(gb_WITH_LANG)),$(gb_WITH_LANG),en-US) - -$(dir $(call gb_AllLangZip_get_target,%)).dir : - $(if $(wildcard $(dir $@)),,mkdir -p $(dir $@)) - -$(call gb_AllLangZip_get_target,%) : - $(call gb_Output_announce,$*,$(true),ALZ,4) - touch $@ - -.PHONY : $(call gb_AllLangZip_get_clean_target,%) -$(call gb_AllLangZip_get_clean_target,%) : - $(call gb_Output_announce,$*,$(true),ALZ,4) - rm -f $(call gb_AllLangZip_get_target,$*) - -# Define a new zip group -# -# NOTE: we cannot add dependencies on the child zips here: Zip fails if -# the source directory does not exist and we cannot test its existence -# because the directory might be generated. So we postpone the -# dependency creation to gb_AllLangZip_add_file. -# -# gb_AllLangZip_AllLangZip group srcdir -define gb_AllLangZip_AllLangZip -$(foreach lang,$(gb_AllLangZip_LANGS),$(call gb_Zip_Zip_internal,$(1)_$(lang),$(2)/$(lang))) - -$(call gb_AllLangZip_get_target,$(1)) :| $(dir $(call gb_AllLangZip_get_target,$(1))).dir - -$$(eval $$(call gb_Module_register_target,$(call gb_AllLangZip_get_target,$(1)),$(call gb_AllLangZip_get_clean_target,$(1)))) -$(call gb_Helper_make_userfriendly_targets,$(1),AllLangZip) - -endef - -define gb_AllLangZip__add_to_zip -$(call gb_Zip_add_file,$(2),$(3)) -$(call gb_AllLangZip_get_target,$(1)) : $(call gb_Zip_get_outdir_target,$(2)) -$(call gb_AllLangZip_get_clean_target,$(1)) : $(call gb_Zip_get_clean_target,$(2)) - -endef - -define gb_AllLangZip__add_file_impl -$(if $(filter $(2),$(gb_AllLangZip_LANGS)),$(call gb_AllLangZip__add_to_zip,$(1),$(1)_$(2),$(3))) - -endef - -define gb_AllLangZip__add_file -$(call gb_AllLangZip__add_file_impl,$(1),$(firstword $(2)),$(subst $() $(),/,$(wordlist 2,$(words $(2)),$(2)))) - -endef - -# Add a file to one of the child zips -# -# The language is taken from the first component of the file name. The -# file is only added if there is a zip defined for the language (i.e., -# if we are building with the language). -# -# gb_AllLangZip_add_file target file -define gb_AllLangZip_add_file -$(call gb_AllLangZip__add_file,$(1),$(subst /, ,$(2))) - -endef - -# Add several files to the child zips at once -# -# gb_AllLangZip_add_files target file(s) -define gb_AllLangZip_add_files -$(foreach file,$(2),$(call gb_AllLangZip_add_file,$(1),$(file))) - -endef - -# Add extra dependency that must exist before the archives can be created -# -# gb_AllLangZip_add_dependency target dep -define gb_AllLangZip_add_dependency -$(foreach lang,$(gb_AllLangZip_LANGS),$(call gb_Zip_add_dependency,$(1)_$(lang),$(2))) - -endef - -# Add extra dependencies that must exist before the archives can be created -# -# gb_AllLangZip_add_dependencies target dep(s) -define gb_AllLangZip_add_dependencies -$(foreach dependency,$(2),$(call gb_AllLangZip_add_dependency,$(1),$(dependency))) - -endef - -# vim: set noet sw=4 ts=4: diff --git a/solenv/gbuild/TargetLocations.mk b/solenv/gbuild/TargetLocations.mk index 50d2d91d5b44..ffc5a93c0eb0 100644 --- a/solenv/gbuild/TargetLocations.mk +++ b/solenv/gbuild/TargetLocations.mk @@ -85,8 +85,8 @@ endef gb_AutoInstallLibs_get_target = $(WORKDIR)/AutoInstallLibs/$(1) gb_AllLangHelp_get_target = $(WORKDIR)/AllLangHelp/$(1) +gb_AllLangPackage_get_target = $(WORKDIR)/AllLangPackage/$(1) gb_AllLangResTarget_get_target = $(WORKDIR)/AllLangRes/$(1) -gb_AllLangZip_get_target = $(WORKDIR)/AllLangZip/$(1) gb_AsmObject_get_target = $(WORKDIR)/AsmObject/$(1).o gb_CObject_get_target = $(WORKDIR)/CObject/$(1).o gb_GenCObject_get_target = $(WORKDIR)/GenCObject/$(1).o @@ -260,8 +260,8 @@ endef $(eval $(call gb_Helper_make_clean_targets,\ AutoInstallLibs \ AllLangHelp \ + AllLangPackage \ AllLangResTarget \ - AllLangZip \ CliAssembly \ CliAssemblyTarget \ CliConfigTarget \ diff --git a/solenv/gbuild/gbuild.mk b/solenv/gbuild/gbuild.mk index 1fa46350279a..3853618fc119 100644 --- a/solenv/gbuild/gbuild.mk +++ b/solenv/gbuild/gbuild.mk @@ -332,7 +332,7 @@ include $(foreach class, \ CliUnoApi \ Zip \ ZipPackage \ - AllLangZip \ + AllLangPackage \ Configuration \ HelpTarget \ AllLangHelp \ |