Avoid potential negative array index access to cached text.
[LibreOffice.git] / solenv / gbuild / CliUnoApi.mk
blobdb8401d0c3061429e631f7da420b2d1aaaa211b1
1 # -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
3 # This file is part of the LibreOffice project.
5 # This Source Code Form is subject to the terms of the Mozilla Public
6 # License, v. 2.0. If a copy of the MPL was not distributed with this
7 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 # CliUnoApi class
12 gb_CliUnoApi_EXT := $(gb_CliAssembly_POLICYEXT)
14 gb_CliUnoApi_KEYFILE_DEFAULT := $(gb_CliAssembly_KEYFILE_DEFAULT)
16 gb_CliUnoApi_DEPS := $(call gb_Executable_get_runtime_dependencies,climaker)
17 gb_CliUnoApi_COMMAND := $(call gb_Executable_get_command,climaker)
19 define gb_CliUnoApi__command
20 $(call gb_Helper_abbreviate_dirs,\
21 $(gb_CliUnoApi_COMMAND) \
22 --out $(1) \
23 --assembly-company "LibreOffice" \
24 --assembly-description "This assembly contains metadata for the LibreOffice API." \
25 --assembly-version $(CLI_UNOAPI_VERSION) \
26 --keyfile $(CLI_UNOAPI_KEYFILE) \
27 $(if $(gb_VERBOSE),--verbose) \
28 $(foreach api,$(CLI_UNOAPI_DEPS),-X $(api)) \
29 $(foreach assembly,$(CLI_UNOAPI_ASSEMBLIES),-r $(assembly)) \
30 $(CLI_UNOAPI_API) \
32 endef
34 .PHONY : $(call gb_CliUnoApi_get_clean_target,%)
35 $(call gb_CliUnoApi_get_clean_target,%) :
36 $(call gb_Output_announce,$*,$(false),CLI,4)
37 $(call gb_Helper_abbreviate_dirs,\
38 rm -f $(call gb_CliUnoApi_get_target,$*) \
42 # Create a CLI library for UNO API
44 # gb_CliUnoApi_CliUnoApi target
45 define gb_CliUnoApi_CliUnoApi
46 $(call gb_CliAssembly_CliAssembly,$(1),$(call gb_CliUnoApi_get_target,$(1)))
48 $(call gb_CliUnoApi_get_target,$(1)) : CLI_UNOAPI_API :=
49 $(call gb_CliUnoApi_get_target,$(1)) : CLI_UNOAPI_ASSEMBLIES :=
50 $(call gb_CliUnoApi_get_target,$(1)) : CLI_UNOAPI_DEPS :=
51 $(call gb_CliUnoApi_get_target,$(1)) : CLI_UNOAPI_KEYFILE :=
52 $(call gb_CliUnoApi_get_target,$(1)) : CLI_UNOAPI_VERSION :=
54 $(call gb_CliUnoApi_set_keyfile,$(1),$(gb_CliUnoApi_KEYFILE_DEFAULT))
56 $(call gb_CliUnoApi_get_target,$(1)) :| $(call gb_CliAssembly_get_target,$(1))
57 $(call gb_CliUnoApi_get_target,$(1)) :| $(dir $(call gb_CliUnoApi_get_target,$(1))).dir
58 $(call gb_CliUnoApi_get_clean_target,$(1)) : $(call gb_CliAssembly_get_clean_target,$(1))
60 $$(eval $$(call gb_Module_register_target,$(call gb_CliUnoApi_get_target,$(1)),$(call gb_CliUnoApi_get_clean_target,$(1))))
61 $(call gb_Helper_make_userfriendly_targets,$(1),CliUnoApi)
64 $(call gb_CliUnoApi_get_target,$(1)) : $(gb_CliUnoApi_DEPS)
65 $$(call gb_Output_announce,$(1),$(true),CLI,4)
66 $$(call gb_Trace_StartRange,$(1),CLI)
67 $$(call gb_CliUnoApi__command,$$@,$(1))
68 $$(call gb_Trace_EndRange,$(1),CLI)
70 endef
72 define gb_CliUnoApi_set_configfile
73 $(call gb_CliAssembly_set_configfile,$(1),$(2),$(3))
75 endef
77 define gb_CliUnoApi_set_keyfile
78 $(call gb_CliAssembly_set_keyfile,$(1),$(2))
79 $(call gb_CliUnoApi_get_target,$(1)) : CLI_UNOAPI_KEYFILE := $(2)
80 $(call gb_CliUnoApi_get_target,$(1)) : $(2)
82 endef
84 define gb_CliUnoApi_set_assembly_version
85 $(call gb_CliUnoApi_get_target,$(1)) : CLI_UNOAPI_VERSION := $(2)
87 endef
89 define gb_CliUnoApi_set_policy
90 $(call gb_CliAssembly_set_policy,$(1),$(2),$(3))
92 endef
94 define gb_CliUnoApi_wrap_api
95 $(call gb_CliUnoApi_get_target,$(1)) : CLI_UNOAPI_API := $(call gb_UnoApiTarget_get_target,$(2))
96 $(call gb_CliUnoApi_get_target,$(1)) : $(call gb_UnoApiTarget_get_target,$(2))
98 endef
100 define gb_CliUnoApi__use_api
101 $(call gb_CliUnoApi_get_target,$(1)) : CLI_UNOAPI_DEPS += $(2)
102 $(call gb_CliUnoApi_get_target,$(1)) : $(2)
104 endef
106 define gb_CliUnoApi_use_api
107 $(foreach api,$(2),$(call gb_CliUnoApi__use_api,$(1),$(call gb_UnoApiTarget_get_target,$(api))))
109 endef
111 define gb_CliUnoApi_use_assembly
112 $(call gb_CliUnoApi_get_target,$(1)) : CLI_UNOAPI_ASSEMBLIES += $(call gb_CliUnoApi_get_target,$(2))
113 $(call gb_CliUnoApi_get_target,$(1)) : $(call gb_CliUnoApi_get_target,$(2))
115 endef
117 define gb_CliUnoApi_use_assemblies
118 $(foreach assembly,$(2),$(call gb_CliUnoApi_use_assembly,$(1),$(assembly)))
120 endef
122 # vim: set noet sw=4 ts=4: