summaryrefslogtreecommitdiffstats
path: root/solenv/gbuild/extensions
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:06:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:06:44 +0000
commited5640d8b587fbcfed7dd7967f3de04b37a76f26 (patch)
tree7a5f7c6c9d02226d7471cb3cc8fbbf631b415303 /solenv/gbuild/extensions
parentInitial commit. (diff)
downloadlibreoffice-cb75148ebd0135178ff46f89a30139c44f8d2040.tar.xz
libreoffice-cb75148ebd0135178ff46f89a30139c44f8d2040.zip
Adding upstream version 4:7.4.7.upstream/4%7.4.7upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'solenv/gbuild/extensions')
-rw-r--r--solenv/gbuild/extensions/post_Counters.mk22
-rw-r--r--solenv/gbuild/extensions/post_Fuzzers.mk17
-rw-r--r--solenv/gbuild/extensions/post_GbuildToJson.mk202
-rw-r--r--solenv/gbuild/extensions/post_PackageInfo.mk116
-rw-r--r--solenv/gbuild/extensions/post_SpeedUpTargets.mk88
-rw-r--r--solenv/gbuild/extensions/pre_BuildTools.mk54
-rw-r--r--solenv/gbuild/extensions/pre_Counters.mk31
-rw-r--r--solenv/gbuild/extensions/pre_MergedLibsList.mk122
8 files changed, 652 insertions, 0 deletions
diff --git a/solenv/gbuild/extensions/post_Counters.mk b/solenv/gbuild/extensions/post_Counters.mk
new file mode 100644
index 000000000..8773844a5
--- /dev/null
+++ b/solenv/gbuild/extensions/post_Counters.mk
@@ -0,0 +1,22 @@
+# -*- 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/.
+#
+
+ifneq ($(filter countoutdated,$(MAKECMDGOALS)),)
+
+gb_Output_announce=
+
+ifneq ($(strip $(filter-out countoutdated,$(MAKECMDGOALS))),)
+countoutdated: $(filter-out countoutdated,$(MAKECMDGOALS))
+else
+countoutdated: $(.DEFAULT_GOAL)
+endif
+
+endif
+
+# vim: set noet ts=4 sw=4:
diff --git a/solenv/gbuild/extensions/post_Fuzzers.mk b/solenv/gbuild/extensions/post_Fuzzers.mk
new file mode 100644
index 000000000..e26e65935
--- /dev/null
+++ b/solenv/gbuild/extensions/post_Fuzzers.mk
@@ -0,0 +1,17 @@
+# -*- 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/.
+#
+
+# chain-link all fuzzer binaries
+$(foreach fuzzer,$(gb_Fuzzers_KNOWN), \
+ $(eval gb_Fuzzers_KNOWN = $(filter-out $(fuzzer),$(gb_Fuzzers_KNOWN))) \
+ $(if $(firstword $(gb_Fuzzers_KNOWN)), \
+ $(eval $(call gb_Executable_get_linktarget_target,$(firstword $(gb_Fuzzers_KNOWN))) : \
+ $(call gb_Executable_get_linktarget_target,$(fuzzer)))))
+
+# vim: set noet sw=4 ts=4:
diff --git a/solenv/gbuild/extensions/post_GbuildToJson.mk b/solenv/gbuild/extensions/post_GbuildToJson.mk
new file mode 100644
index 000000000..f1707a488
--- /dev/null
+++ b/solenv/gbuild/extensions/post_GbuildToJson.mk
@@ -0,0 +1,202 @@
+# -*- 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/.
+#
+
+
+# Outstanding work:
+#
+# fill files names in:
+# --ASMOBJECTS
+# --GENCOBJECTS
+# --YACCOBJECTS
+# --LEXOBJECTS
+# --JAVAOBJECTS
+# --PYTHONOBJECTS
+#
+# Add black listed modules a json files (--DENYLIST)
+#
+# Reduce number of denylisted modules
+
+ifneq ($(filter gbuildtojson,$(MAKECMDGOALS)),)
+
+# possibly recurse to ensure gbuildtojson was build before running the modded make
+gb_GbuildToJson_prep := $(shell $(MAKE) -f $(SRCDIR)/solenv/Makefile Executable_gbuildtojson)
+gb_FULLDEPS:=
+
+gbuildtojson:
+ @true
+
+
+gb_GbuildToJson_PHONY := $(WORKDIR)/GBUILDTOJSONPHONY
+.PHONY : $(gb_GbuildToJson_PHONY)
+$(gb_GbuildToJson_PHONY):
+ @true
+
+
+
+define gb_LinkTarget__command
+mkdir -p $(WORKDIR)/GbuildToJson/$(dir $(2))
+mkdir -p $(WORKDIR)/LinkTarget/$(dir $(2))
+$(if $(GBUILDTOJSON_LD_LIBRARY_PATH),LD_LIBRARY_PATH=$(GBUILDTOJSON_LD_LIBRARY_PATH)) \
+$(call gb_Executable_get_command,gbuildtojson) \
+--makefile=$(call gb_var2file,$(shell $(gb_MKTEMP)),100,$(T_MAKEFILE)) \
+--linktarget=$(call gb_var2file,$(shell $(gb_MKTEMP)),100,$(2)) \
+--ilibtarget=$(call gb_var2file,$(shell $(gb_MKTEMP)),100,$(ILIBTARGET)) \
+--cxxobjects=$(call gb_var2file,$(shell $(gb_MKTEMP)),100,$(CXXOBJECTS)) \
+--yaccobjects=$(call gb_var2file,$(shell $(gb_MKTEMP)),100,$(YACCOBJECTS)) \
+--objcobjects=$(call gb_var2file,$(shell $(gb_MKTEMP)),100,$(OBJCOBJECTS)) \
+--objcxxobjects=$(call gb_var2file,$(shell $(gb_MKTEMP)),100,$(OBJCXXOBJECTS)) \
+--cxxclrobjects=$(call gb_var2file,$(shell $(gb_MKTEMP)),100,$(CXXCLROBJECTS)) \
+--asmobjects=$(call gb_var2file,$(shell $(gb_MKTEMP)),100,$(ASMOBJECTS)) \
+--lexobjects=$(call gb_var2file,$(shell $(gb_MKTEMP)),100,$(LEXOBJECTS)) \
+--gencobjects=$(call gb_var2file,$(shell $(gb_MKTEMP)),100,$(GENCOBJECTS)) \
+--gencxxobjects=$(call gb_var2file,$(shell $(gb_MKTEMP)),100,$(GENCXXOBJECTS)) \
+--gencxxclrobjects=$(call gb_var2file,$(shell $(gb_MKTEMP)),100,$(GENCXXCLROBJECTS)) \
+--cobjects=$(call gb_var2file,$(shell $(gb_MKTEMP)),100,$(COBJECTS)) \
+--javaobjects=$(call gb_var2file,$(shell $(gb_MKTEMP)),100,$(JAVAOBJECTS)) \
+--pythonobjects=$(call gb_var2file,$(shell $(gb_MKTEMP)),100,$(PYTHONOBJECTS)) \
+--cflags=$(call gb_var2file,$(shell $(gb_MKTEMP)),100,$(T_CFLAGS)) \
+--cflagsappend=$(call gb_var2file,$(shell $(gb_MKTEMP)),100,$(T_CFLAGS_APPEND)) \
+--cxxflags=$(call gb_var2file,$(shell $(gb_MKTEMP)),100,$(T_CXXFLAGS)) \
+--cxxflagsappend=$(call gb_var2file,$(shell $(gb_MKTEMP)),100,$(T_CXXFLAGS_APPEND)) \
+--objcflags=$(call gb_var2file,$(shell $(gb_MKTEMP)),100,$(T_OBJCFLAGS)) \
+--objcflagsappend=$(call gb_var2file,$(shell $(gb_MKTEMP)),100,$(T_OBJCFLAGS_APPEND)) \
+--objcxxflags=$(call gb_var2file,$(shell $(gb_MKTEMP)),100,$(T_OBJCXXFLAGS)) \
+--objcxxflagsappend=$(call gb_var2file,$(shell $(gb_MKTEMP)),100,$(T_OBJCXXFLAGS_APPEND)) \
+--cxxclrflags=$(call gb_var2file,$(shell $(gb_MKTEMP)),100,$(T_CXXCLRFLAGS)) \
+--cxxclrflagsappend=$(call gb_var2file,$(shell $(gb_MKTEMP)),100,$(T_CXXCLRFLAGS_APPEND)) \
+--defs=$(call gb_var2file,$(shell $(gb_MKTEMP)),100,$(DEFS)) \
+--include=$(call gb_var2file,$(shell $(gb_MKTEMP)),100,$(INCLUDE)) \
+--linked_libs=$(call gb_var2file,$(shell $(gb_MKTEMP)),100,$(LINKED_LIBS)) \
+--linked_static_libs=$(call gb_var2file,$(shell $(gb_MKTEMP)),100,$(LINKED_STATIC_LIBS)) \
+> $(WORKDIR)/GbuildToJson/$(2)
+endef
+
+define gb_Postprocess_register_target
+gbuildtojson : $(call gb_LinkTarget_get_target,$(call gb_$(2)_get_linktarget,$(3)))
+
+$(call gb_LinkTarget_get_target,$(call gb_$(2)_get_linktarget,$(3))): $(gb_Helper_MISCDUMMY) $(gb_GbuildToJson_PHONY)
+$(call gb_LinkTarget_get_target,$(call gb_$(2)_get_linktarget,$(3))): T_MAKEFILE := $(lastword $(MAKEFILE_LIST))
+endef
+
+define gb_CppunitTest_register_target
+gbuildtojson : $(call gb_LinkTarget_get_target,$(2))
+
+$(call gb_LinkTarget_get_target,$(2)): $(gb_Helper_MISCDUMMY) $(gb_GbuildToJson_PHONY)
+$(call gb_LinkTarget_get_target,$(2)): T_MAKEFILE := $(lastword $(MAKEFILE_LIST))
+endef
+
+gb_LinkTarget_use_static_libraries =
+gb_UnoApiHeadersTarget_get_target = $(gb_Helper_MISCDUMMY)
+gb_UnpackedTarball_get_final_target = $(gb_Helper_MISCDUMMY)
+gb_LinkTarget__get_headers_check =
+define gb_LinkTarget_add_cobject
+$(call gb_LinkTarget_get_target,$(1)) : COBJECTS += $(2)
+
+endef
+define gb_LinkTarget_add_cxxobject_internal
+$(call gb_LinkTarget_get_target,$(1)) : CXXOBJECTS += $(2)
+
+endef
+define gb_LinkTarget_add_generated_c_object
+$(call gb_LinkTarget_get_target,$(1)) : GENCOBJECTS += $(2)
+
+endef
+define gb_LinkTarget_add_generated_cxx_object_internal
+$(call gb_LinkTarget_get_target,$(1)) : GENCXXOBJECTS += $(2)
+
+endef
+define gb_LinkTarget_add_generated_cxxclrobject
+$(call gb_LinkTarget_get_target,$(1)) : GENCXXCLROBJECTS += $(2)
+
+endef
+define gb_LinkTarget_add_objcobject
+$(call gb_LinkTarget_get_target,$(1)) : OBJCOBJECTS += $(2)
+
+endef
+define gb_LinkTarget_add_objcxxobject
+$(call gb_LinkTarget_get_target,$(1)) : OBJCXXOBJECTS += $(2)
+
+endef
+define gb_LinkTarget_add_cxxclrobject
+$(call gb_LinkTarget_get_target,$(1)) : CXXCLROBJECTS += $(2)
+
+endef
+define gb_LinkTarget_add_scanners
+$(call gb_LinkTarget_get_target,$(1)) : LEXOBJECTS += $(2)
+
+endef
+define gb_LinkTarget_add_grammars
+$(call gb_LinkTarget_get_target,$(1)) : YACCOBJECTS += $(2)
+
+endef
+gb_LinkTarget_use_package =
+gb_LinkTarget_use_generated_package =
+gb_LinkTarget_add_sdi_headers =
+gb_LinkTarget_use_external_project =
+gb_LinkTarget__check_srcdir_paths =
+gb_LinkTarget__command_objectlist = @true
+gb_WinResTarget_WinResTarget_init =
+gb_WinResTarget_set_rcfile =
+gb_WinResTarget_add_defs =
+gb_LinkTarget_set_nativeres =
+gb_LinkTarget_add_nativeres =
+gb_Library_set_componentfile =
+gb_Library_add_componentimpl =
+
+#$(call gb_Library_get_exports_target,%):
+$(WORKDIR)/LinkTarget/Library/%.exports:
+ @true
+
+define gb_LinkTarget__use_custom_headers
+$(call gb_LinkTarget__add_include,$(1),$(call gb_CustomTarget_get_workdir,$(2)))
+
+endef
+
+
+define gb_Module__add_target_impl
+$(call gb_Module__read_targetfile,$(1),$(2),target)
+
+$(call gb_Module_get_nonl10n_target,$(1)) : $(3)
+
+endef
+
+define gb_Module__add_check_target_impl
+$(call gb_Module__read_targetfile,$(1),$(2),check target)
+
+$(call gb_Module_get_check_target,$(1)) : $(3)
+
+endef
+
+define gb_Module_add_target
+$(if $(filter Library_% Executable_%,$(2)),$(call gb_Module__add_target_impl,$(1),$(2),$$(gb_Module_CURRENTTARGET)))
+endef
+
+define gb_Module_add_check_target
+$(if $(filter CppunitTest_% Library_%,$(2)),$(call gb_Module__add_check_target_impl,$(1),$(2),$$(gb_Module_CURRENTTARGET)))
+endef
+
+gb_Module_add_l10n_target =
+
+gb_GbuildToJson_DENYLISTEDMODULES := cli_ure jurt external
+
+define gb_Module__add_moduledir_impl
+include $(patsubst $(1):%,%,$(filter $(1):%,$(gb_Module_MODULELOCATIONS)))/$(2)/Module_$(notdir $(2)).mk
+$(call gb_Module_get_target,$(1)) : $$(firstword $$(gb_Module_TARGETSTACK))
+gb_Module_TARGETSTACK := $$(wordlist 2,$$(words $$(gb_Module_TARGETSTACK)),$$(gb_Module_TARGETSTACK))
+
+endef
+
+define gb_Module_add_moduledir
+$(if $(filter $(gb_GbuildToJson_DENYLISTEDMODULES),$(2)),,$(call gb_Module__add_moduledir_impl,$(1),$(2)))
+
+endef
+
+endif
+
+# vim: set noet ts=4 sw=4:
diff --git a/solenv/gbuild/extensions/post_PackageInfo.mk b/solenv/gbuild/extensions/post_PackageInfo.mk
new file mode 100644
index 000000000..331eeb89e
--- /dev/null
+++ b/solenv/gbuild/extensions/post_PackageInfo.mk
@@ -0,0 +1,116 @@
+# -*- 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/.
+#
+
+gb_PackageInfo_InstallModules := \
+ base \
+ calc \
+ graphicsfilter \
+ tde \
+ impress \
+ onlineupdate \
+ gnome \
+ kde \
+ math \
+ ooo \
+ writer \
+ ure \
+ activexbinarytable \
+ ooobinarytable \
+ winexplorerextbinarytable \
+
+define gb_PackageInfo_emit_binaries_command
+@touch $(foreach suf,executables libraries files,$(gb_PackageInfo_get_target)/$(1).$(suf))
+@$(foreach executable,$(gb_Executable_MODULE_$(1)),echo "$(patsubst $(INSTDIR)/%,%,$(call gb_Executable_get_target,$(executable)))" >> $(gb_PackageInfo_get_target)/$(1).executables &&) true
+@$(foreach library,$(gb_SdkLinkLibrary_MODULE_$(1)),echo "sdk/lib/$(call gb_Library_get_linktarget,$(library))" >> $(gb_PackageInfo_get_target)/$(1).sdklinklibraries &&) true
+@$(foreach library,$(gb_Library_MODULE_$(1)),echo "$(patsubst $(INSTDIR)/%,%,$(call gb_Library_get_target,$(library)))" >> $(gb_PackageInfo_get_target)/$(1).libraries &&) true
+@$(foreach jar,$(gb_Jar_MODULE_$(1)),echo "$(patsubst $(INSTDIR)/%,%,$(call gb_Jar_get_target,$(jar)))" >> $(gb_PackageInfo_get_target)/$(1).jars &&) true
+@$(foreach pkg,$(gb_Package_MODULE_$(1)),echo "$(call gb_Package_get_target,$(pkg))" >> $(gb_PackageInfo_get_target)/$(1).packages &&) true
+@echo "$(foreach suf,executables libraries files,$(gb_PackageInfo_get_target)/$(1).$(suf)) \\" >> $(WORKDIR)/Dep/packageinfo.d
+
+endef
+
+define gb_PackageInfo_emit_help_for_one_target
+$(foreach suf,cfg db ht idxl/_0.cfs idxl/segments_3 idxl/segments.gen jar key tree,$(if $(wildcard $(INSTDIR)/help/$(1).$(suf)),echo "help/$(1).$(suf)" >> $(2) && )) true
+
+endef
+
+define gb_PackageInfo_emit_help_for_one_lang
+@touch $(foreach suf,executables libraries files,$(gb_PackageInfo_get_target)/help-$(1).$(suf))
+$(foreach target,$(gb_AllLangHelp_ALLTARGETS),$(call gb_PackageInfo_emit_help_for_one_target,$(1)/$(target),$(gb_PackageInfo_get_target)/help-$(1).files))
+$(foreach suf,html css,$(foreach file,$(wildcard $(INSTDIR)/help/$(1)/*.$(suf)),echo "$(patsubst $(INSTDIR)/%,%,$(file))" >> $(gb_PackageInfo_get_target)/help-$(1).files && )) true
+@echo " $(foreach suf,executables libraries files,$(gb_PackageInfo_get_target)/help-$(1).$(suf)) \\" >> $(WORKDIR)/Dep/packageinfo.d
+
+endef
+
+#getting the package files post-hoc with wildcard is not good and should be done better
+define gb_PackageInfo_emit_l10n_for_one_alllangpackage
+@$(foreach file,$(shell ls $(INSTDIR)/$(1)/$(2)),echo "$(1)/$(2)/$(file)" >> $(gb_PackageInfo_get_target)/l10n-$(2).files &&) true
+
+endef
+
+define gb_PackageInfo_emit_l10n_for_one_mo
+@echo "$(patsubst $(INSTDIR)/%,%,$(call gb_MoTarget_get_install_target,$(shell $(SRCDIR)/solenv/bin/localestr $(2))/LC_MESSAGES/$(1)))" >> $(gb_PackageInfo_get_target)/l10n-$(2).files
+
+endef
+
+define gb_PackageInfo_emit_l10n_for_one_configfile
+echo "$(LIBO_SHARE_FOLDER)/registry/$(2)$(1).xcd" >> $(gb_PackageInfo_get_target)/l10n-$(1).files
+
+endef
+
+define gb_PackageInfo_emit_l10n_for_one_lang
+@touch $(foreach suf,executables libraries files,$(gb_PackageInfo_get_target)/l10n-$(1).$(suf))
+$(if $(filter-out qtz en-US,$(1)),$(foreach packagedir,$(patsubst %/,%,$(gb_AllLangPackage_ALLDIRS)),$(call gb_PackageInfo_emit_l10n_for_one_alllangpackage,$(packagedir),$(1))))
+$(if $(filter $(gb_AllLangMoTarget_LANGS),$(1)),$(foreach target,$(gb_AllLangMoTarget_REGISTERED),$(call gb_PackageInfo_emit_l10n_for_one_mo,$(target),$(1))))
+$(if $(filter $(gb_Configuration_LANGS),$(1)),$(foreach configfile,Langpack- res/fcfg_langpack_ res/registry_,$(call gb_PackageInfo_emit_l10n_for_one_configfile,$(1),$(configfile))))
+$(if $(filter $(gb_CJK_LANGS),$(1)),$(foreach configfile,cjk_,$(call gb_PackageInfo_emit_l10n_for_one_configfile,$(1),$(configfile))))
+$(if $(filter $(gb_CTL_LANGS),$(1)),$(foreach configfile,ctl_,$(call gb_PackageInfo_emit_l10n_for_one_configfile,$(1),$(configfile))))
+$(if $(filter $(gb_CTLSEQCHECK_LANGS),$(1)),$(foreach configfile,ctlseqcheck_,$(call gb_PackageInfo_emit_l10n_for_one_configfile,$(1),$(configfile))))
+@echo "$(foreach suf,executables libraries files,$(gb_PackageInfo_get_target)/l10n-$(1).$(suf)) \\" >> $(WORKDIR)/Dep/packageinfo.d
+
+endef
+
+-include $(WORKDIR)/Dep/packageinfo.d
+$(foreach filelist,files executables libraries,$(gb_PackageInfo_get_target)/%.$(filelist)):
+ @rm -rf $(gb_PackageInfo_get_target) $(WORKDIR)/Dep/packageinfo.d && mkdir $(gb_PackageInfo_get_target)
+ $(foreach installmodule,$(gb_PackageInfo_InstallModules),$(call gb_PackageInfo_emit_binaries_command,$(installmodule)))
+ $(foreach helplang,$(gb_HELP_LANGS),$(call gb_PackageInfo_emit_help_for_one_lang,$(helplang)))
+ $(foreach l10nlang,$(if $(strip $(gb_WITH_LANG)),$(gb_WITH_LANG),en-US),$(call gb_PackageInfo_emit_l10n_for_one_lang,$(l10nlang)))
+ @echo "$(gb_PackageInfo_get_target)/packageinfo_all : $(filter-out $(WORKDIR)/Dep/%,$(MAKEFILE_LIST))" >> $(WORKDIR)/Dep/packageinfo.d
+ @touch $(gb_PackageInfo_get_target)/packageinfo_all
+
+$(gb_PackageInfo_get_target)/packageinfo_all:
+ $(MAKE) -f $(firstword $(MAKEFILE_LIST)) $(gb_PackageInfo_get_target)/$(firstword $(gb_PackageInfo_InstallModules)).files
+
+.PHONY : packageinfo
+packageinfo: $(gb_PackageInfo_get_target)/packageinfo_all
+
+install-package-%: $(gb_PackageInfo_get_target)/packageinfo_all
+ for executable in `cat $(gb_PackageInfo_get_target)/$*.executables`; \
+ do \
+ install -D $(INSTDIR)/$${executable} $(INSTALLDIR)/$${executable} ;\
+ done
+ for library in `cat $(gb_PackageInfo_get_target)/$*.sdklinklibraries`; \
+ do \
+ install -D -m644 $(INSTDIR)/$${library} $(INSTALLDIR)/$${library}; \
+ done
+ for library in `cat $(gb_PackageInfo_get_target)/$*.libraries`; \
+ do \
+ install -D -m644 $(INSTDIR)/$${library} $(INSTALLDIR)/$${library}; \
+ done
+ for jar in `cat $(gb_PackageInfo_get_target)/$*.jars`; \
+ do \
+ install -D -m644 $(INSTDIR)/$${jar} $(INSTALLDIR)/$${jar}; \
+ done
+ for file in `cat $(gb_PackageInfo_get_target)/$*.files`; \
+ do \
+ install -D -m644 $(INSTDIR)/$${file} $(INSTALLDIR)/$${file}; \
+ done
+
+# vim: set noet sw=4 ts=4:
diff --git a/solenv/gbuild/extensions/post_SpeedUpTargets.mk b/solenv/gbuild/extensions/post_SpeedUpTargets.mk
new file mode 100644
index 000000000..3db6355ab
--- /dev/null
+++ b/solenv/gbuild/extensions/post_SpeedUpTargets.mk
@@ -0,0 +1,88 @@
+# -*- 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/.
+#
+
+ifneq ($(CROSS_COMPILING),)
+gb_Module_add_targets_for_build :=
+gb_Module_SKIPTARGETS := check slowcheck screenshot subsequentcheck uicheck
+endif
+
+ifeq ($(gb_Side),build)
+gb_Module_SKIPTARGETS := check slowcheck screenshot subsequentcheck uicheck
+endif
+
+ifeq ($(MAKECMDGOALS),build)
+gb_Module_SKIPTARGETS := check slowcheck screenshot subsequentcheck uicheck
+endif
+
+ifeq (,$(filter perfcheck,$(MAKECMDGOALS)))
+gb_Module_SKIPTARGETS += perfcheck
+else
+gb_Module_SKIPTARGETS += check slowcheck screenshot subsequentcheck uicheck
+endif
+
+ifneq ($(strip $(MAKECMDGOALS)),)
+# speed up depending on the target
+gb_SpeedUpTargets_LEVEL_4 := debugrun help translations install-package-% packageinfo
+gb_SpeedUpTargets_LEVEL_3 := showmodules $(gb_SpeedUpTargets_LEVEL_4)
+gb_SpeedUpTargets_LEVEL_2 := $(gb_SpeedUpTargets_LEVEL_3)
+gb_SpeedUpTargets_LEVEL_1 := clean showdeliverables $(gb_PackageInfo_get_target)/% $(gb_SpeedUpTargets_LEVEL_2)
+
+ifeq (T,$(if $(filter-out $(gb_SpeedUpTargets_LEVEL_1),$(MAKECMDGOALS)),,T))
+gb_FULLDEPS :=
+
+ifeq (T,$(if $(filter-out $(gb_SpeedUpTargets_LEVEL_2),$(MAKECMDGOALS)),,T))
+gb_Module_SKIPTARGETS += check slowcheck screenshot subsequentcheck uicheck
+
+ifeq (T,$(if $(filter-out $(gb_SpeedUpTargets_LEVEL_3),$(MAKECMDGOALS)),,T))
+gb_Module_SKIPTARGETS += build
+
+ifeq (T,$(if $(filter-out $(gb_SpeedUpTargets_LEVEL_4),$(MAKECMDGOALS)),,T))
+gb_Module_SKIPTARGETS += module
+
+endif
+endif
+endif
+endif
+
+endif
+
+
+ifneq (,$(filter build,$(gb_Module_SKIPTARGETS)))
+gb_Module_add_target =
+endif
+
+ifneq (,$(filter check,$(gb_Module_SKIPTARGETS)))
+gb_Module_add_check_target =
+endif
+
+ifneq (,$(filter slowcheck,$(gb_Module_SKIPTARGETS)))
+gb_Module_add_slowcheck_target =
+endif
+
+ifneq (,$(filter screenshot,$(gb_Module_SKIPTARGETS)))
+gb_Module_add_screenshot_target =
+endif
+
+ifneq (,$(filter subsequentcheck,$(gb_Module_SKIPTARGETS)))
+gb_Module_add_subsequentcheck_target =
+endif
+
+ifneq (,$(filter perfcheck,$(gb_Module_SKIPTARGETS)))
+gb_Module_add_perfcheck_target =
+endif
+
+ifneq (,$(filter uicheck,$(gb_Module_SKIPTARGETS)))
+gb_Module_add_uicheck_target =
+endif
+
+ifneq (,$(filter module,$(gb_Module_SKIPTARGETS)))
+gb_Module_add_moduledir =
+endif
+
+# vim:set shiftwidth=4 softtabstop=4 noexpandtab:
diff --git a/solenv/gbuild/extensions/pre_BuildTools.mk b/solenv/gbuild/extensions/pre_BuildTools.mk
new file mode 100644
index 000000000..0a83545cf
--- /dev/null
+++ b/solenv/gbuild/extensions/pre_BuildTools.mk
@@ -0,0 +1,54 @@
+# -*- 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/.
+#
+
+# Tools we need to build for cross-compiling
+ifeq ($(gb_Side),build)
+
+gb_BUILD_TOOLS_executables = \
+ bestreversemap \
+ cfgex \
+ climaker \
+ cpp \
+ cppumaker \
+ gencoll_rule \
+ genconv_dict \
+ gendict \
+ $(if $(WITH_GALLERY_BUILD),gengal) \
+ genindex_data \
+ helpex \
+ idxdict \
+ javamaker \
+ $(call gb_CondExeLockfile,lockfile) \
+ makedepend \
+ propex \
+ saxparser \
+ svidl \
+ treex \
+ ulfex \
+ unoidl-check \
+ unoidl-write \
+ xrmex \
+ $(call gb_Helper_optional,HELPTOOLS, \
+ HelpIndexer \
+ HelpLinker \
+ ) \
+ $(if $(filter WNT,$(OS)),$(call gb_Helper_optional,DESKTOP,lngconvex)) \
+
+gb_BUILD_TOOLS_executables_extern = \
+ python \
+ xsltproc \
+
+gb_BUILD_TOOLS = \
+ $(foreach executable,$(gb_BUILD_TOOLS_executables),$(call gb_Executable_get_runtime_dependencies,$(executable))) \
+ $(foreach executable,$(gb_BUILD_TOOLS_executables_extern),$(call gb_ExternalExecutable_get_dependencies,$(executable))) \
+ $(INSTROOT)/$(LIBO_URE_ETC_FOLDER)/$(call gb_Helper_get_rcfile,uno) \
+
+endif
+
+# vim: set noet sw=4 ts=4:
diff --git a/solenv/gbuild/extensions/pre_Counters.mk b/solenv/gbuild/extensions/pre_Counters.mk
new file mode 100644
index 000000000..eaec75069
--- /dev/null
+++ b/solenv/gbuild/extensions/pre_Counters.mk
@@ -0,0 +1,31 @@
+# -*- 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/.
+#
+
+gb_CountersOutdated_COUNTER_ALL:=
+gb_CountersOutdated_COUNTER_TYPES:=
+
+.PHONY: countoutdated
+countoutdated:
+ $(info total outdated files: $(words $(gb_CountersOutdated_COUNTER_ALL)))
+ $(info types of outdated files: $(gb_CountersOutdated_TYPES))
+ $(foreach type,$(gb_CountersOutdated_TYPES),$(info $(type): $(words $(gb_CountersOutdated_COUNTER_$(type)))))
+ @true
+
+ifneq ($(filter countoutdated,$(MAKECMDGOALS)),)
+
+$(WORKDIR)/%:
+ $(eval gb_CountersOutdated_COUNTER_ALL+= x)
+ $(eval gb_CountersOutdated__TYPE=$(firstword $(subst /, ,$*)))
+ $(if $(filter undefined,$(origin gb_CountersOutdated_COUNTER_$(gb_CountersOutdated__TYPE))),$(eval gb_CountersOutdated_COUNTER_$(gb_CountersOutdated__TYPE):=) $(eval gb_CountersOutdated_TYPES+=$(gb_CountersOutdated__TYPE)))
+ $(eval gb_CountersOutdated_COUNTER_$(gb_CountersOutdated__TYPE)+= x)
+ @true
+
+endif
+
+# vim: set noet ts=4 sw=4:
diff --git a/solenv/gbuild/extensions/pre_MergedLibsList.mk b/solenv/gbuild/extensions/pre_MergedLibsList.mk
new file mode 100644
index 000000000..b2402ec0c
--- /dev/null
+++ b/solenv/gbuild/extensions/pre_MergedLibsList.mk
@@ -0,0 +1,122 @@
+# -*- 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/.
+#
+
+# we link all object files from these libraries into one, merged library
+gb_MERGE_LIBRARY_LIST := \
+ avmedia \
+ $(if $(filter WNT,$(OS)),avmediawin) \
+ $(call gb_Helper_optional,SCRIPTING, \
+ basctl \
+ basprov \
+ ) \
+ basegfx \
+ canvasfactory \
+ canvastools \
+ comphelper \
+ configmgr \
+ cppcanvas \
+ $(call gb_Helper_optional,BREAKPAD,crashreport) \
+ ctl \
+ dbtools \
+ deployment \
+ deploymentmisc \
+ $(if $(filter-out MACOSX WNT,$(OS)),desktopbe1) \
+ $(if $(filter WNT,$(OS)),directx9canvas) \
+ drawinglayercore \
+ drawinglayer \
+ editeng \
+ emfio \
+ $(if $(filter WNT,$(OS)),emser) \
+ evtatt \
+ filterconfig \
+ for \
+ forui \
+ fps_office \
+ frm \
+ fsstorage \
+ fwk \
+ $(if $(filter WNT,$(OS)),gdipluscanvas) \
+ guesslang \
+ $(call gb_Helper_optional,DESKTOP,helplinker) \
+ hyphen \
+ i18nsearch \
+ i18npool \
+ i18nutil \
+ lng \
+ lnth \
+ localebe1 \
+ msfilter \
+ mtfrenderer \
+ numbertext \
+ odfflatxml \
+ offacc \
+ $(if $(ENABLE_OPENGL_CANVAS),oglcanvas) \
+ $(if $(filter OPENCL,$(BUILD_TYPE)),opencl) \
+ package2 \
+ passwordcontainer \
+ sax \
+ sb \
+ simplecanvas \
+ sfx \
+ sofficeapp \
+ sot \
+ spell \
+ $(if $(or $(DISABLE_GUI),$(ENABLE_WASM_STRIP_SPLASH)),,spl) \
+ srtrs1 \
+ $(call gb_Helper_optional,SCRIPTING,stringresource) \
+ svgio \
+ svl \
+ svt \
+ svx \
+ svxcore \
+ syssh \
+ textfd \
+ tk \
+ tl \
+ ucb1 \
+ ucbhelper \
+ ucpexpand1 \
+ ucpext \
+ ucphier1 \
+ ucpimage \
+ ucpfile1 \
+ ucptdoc1 \
+ unordf \
+ unoxml \
+ updatefeed \
+ utl \
+ uui \
+ vbaevents \
+ vbahelper \
+ vcl \
+ vclcanvas \
+ xmlfa \
+ xmlfd \
+ xmlscript \
+ xo \
+ xof \
+ xsltdlg \
+ xsltfilter \
+ xstor \
+
+
+# allow module-deps.pl to color based on this.
+ifneq ($(ENABLE_PRINT_DEPS),)
+
+$(info MergeLibContents: $(gb_MERGE_LIBRARY_LIST))
+
+endif
+
+ifneq ($(MERGELIBS),)
+
+gb_MERGEDLIBS := $(gb_MERGE_LIBRARY_LIST)
+
+endif
+
+# vim: set noet sw=4 ts=4: