Branch libreoffice-5-0-4
[LibreOffice.git] / solenv / gbuild / CliUnoApi.mk
blob16f331b48ec90d2a39182ad9845106a1ed9bfe35
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_Output_announce,$(2),$(true),CLI,4)
21 $(call gb_Helper_abbreviate_dirs,\
22 $(gb_CliUnoApi_COMMAND) \
23 --out $(1) \
24 --assembly-company "LibreOffice" \
25 --assembly-description "This assembly contains metadata for the LibreOffice API." \
26 --assembly-version $(CLI_UNOAPI_VERSION) \
27 --keyfile $(CLI_UNOAPI_KEYFILE) \
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_CliUnoApi__command,$$@,$(1))
67 endef
69 define gb_CliUnoApi_set_configfile
70 $(call gb_CliAssembly_set_configfile,$(1),$(2))
72 endef
74 define gb_CliUnoApi_set_keyfile
75 $(call gb_CliAssembly_set_keyfile,$(1),$(2))
76 $(call gb_CliUnoApi_get_target,$(1)) : CLI_UNOAPI_KEYFILE := $(2)
77 $(call gb_CliUnoApi_get_target,$(1)) : $(2)
79 endef
81 define gb_CliUnoApi_set_assembly_version
82 $(call gb_CliUnoApi_get_target,$(1)) : CLI_UNOAPI_VERSION := $(2)
84 endef
86 define gb_CliUnoApi_set_policy
87 $(call gb_CliAssembly_set_policy,$(1),$(2),$(3))
89 endef
91 define gb_CliUnoApi_wrap_api
92 $(call gb_CliUnoApi_get_target,$(1)) : CLI_UNOAPI_API := $(call gb_UnoApiTarget_get_target,$(2))
93 $(call gb_CliUnoApi_get_target,$(1)) : $(call gb_UnoApiTarget_get_target,$(2))
95 endef
97 define gb_CliUnoApi__use_api
98 $(call gb_CliUnoApi_get_target,$(1)) : CLI_UNOAPI_DEPS += $(2)
99 $(call gb_CliUnoApi_get_target,$(1)) : $(2)
101 endef
103 define gb_CliUnoApi_use_api
104 $(foreach api,$(2),$(call gb_CliUnoApi__use_api,$(1),$(call gb_UnoApiTarget_get_target,$(api))))
106 endef
108 define gb_CliUnoApi_use_assembly
109 $(call gb_CliUnoApi_get_target,$(1)) : CLI_UNOAPI_ASSEMBLIES += $(call gb_CliUnoApi_get_target,$(2))
110 $(call gb_CliUnoApi_get_target,$(1)) : $(call gb_CliUnoApi_get_target,$(2))
112 endef
114 define gb_CliUnoApi_use_assemblies
115 $(foreach assembly,$(2),$(call gb_CliUnoApi_use_assembly,$(1),$(assembly)))
117 endef
119 # vim: set noet sw=4 ts=4: