Avoid potential negative array index access to cached text.
[LibreOffice.git] / solenv / gbuild / UnoApi.mk
blob9ed314703f3385f2fd71c789a4ec50dec5409457
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 .PHONY : $(call gb_UnoApi_get_clean_target,%)
11 $(call gb_UnoApi_get_clean_target,%) :
12 $(call gb_Helper_abbreviate_dirs,\
13 rm -f $(call gb_UnoApi_get_target,$*))
15 # call gb_UnoApi_UnoApi,api
16 define gb_UnoApi_UnoApi
17 $(call gb_UnoApiTarget_UnoApiTarget,$(1),$(1))
18 $(call gb_UnoApiHeadersTarget_UnoApiHeadersTarget,$(1))
20 $(call gb_UnoApi_get_target,$(1)) :| $(dir $(call gb_UnoApi_get_target,$(1))).dir
21 $(call gb_UnoApi_get_target,$(1)) : $(call gb_UnoApiTarget_get_target,$(1))
22 $(call gb_UnoApi_get_target,$(1)) :| $(call gb_UnoApiHeadersTarget_get_target,$(1))
23 $(call gb_UnoApi_get_clean_target,$(1)) : $(call gb_UnoApiTarget_get_clean_target,$(1))
24 $(call gb_UnoApi_get_clean_target,$(1)) : $(call gb_UnoApiHeadersTarget_get_clean_target,$(1))
26 $(call gb_Deliver_add_deliverable,$(call gb_UnoApi_get_target,$(1)),$(call gb_UnoApiTarget_get_target,$(1)),$(1))
28 $$(eval $$(call gb_Module_register_target,$(call gb_UnoApi_get_target,$(1)),$(call gb_UnoApi_get_clean_target,$(1))))
29 $(call gb_Helper_make_userfriendly_targets,$(1),UnoApi)
31 endef
33 # For enum types, plain struct types, polymorphic struct type templates,
34 # exception types, interface types, typedefs, and constant groups:
35 define gb_UnoApi_add_idlfiles
36 $(call gb_UnoApiTarget_add_idlfiles,$(1),$(2),$(3))
37 $(call gb_UnoApiHeadersTarget_add_headerfiles,$(1),$(2),$(addsuffix .hpp,$(3)))
38 $(call gb_UnoApiHeadersTarget_add_headerfiles,$(1),$(2),$(addsuffix .hdl,$(3)))
39 $(if $(filter EMSCRIPTEN, $(OS)),\
40 $(call gb_UnoApiHeadersTarget_add_embind,$(1),$(2),$(addsuffix _embind,$(3))))
42 endef
44 # For single-interface--based services and interface-based singletons:
45 define gb_UnoApi_add_idlfiles_nohdl
46 $(call gb_UnoApiTarget_add_idlfiles,$(1),$(2),$(3))
47 $(call gb_UnoApiHeadersTarget_add_headerfiles,$(1),$(2),$(addsuffix .hpp,$(3)))
49 endef
51 # For accumulation-based services and service-based singletons:
52 define gb_UnoApi_add_idlfiles_noheader
53 $(call gb_UnoApiTarget_add_idlfiles,$(1),$(2),$(3))
55 endef
57 define gb_UnoApi__use_api
58 $(call gb_UnoApiTarget_use_api,$(1),$(2))
59 $(call gb_UnoApiHeadersTarget_use_api,$(1),$(2))
60 $(call gb_UnoApi_get_target,$(1)) :| $(call gb_UnoApi_get_target,$(2))
62 endef
64 define gb_UnoApi_use_api
65 $(foreach rdb,$(2),$(call gb_UnoApi__use_api,$(1),$(rdb)))
67 endef
69 define gb_UnoApi_set_reference_rdbfile
70 $(call gb_UnoApiTarget_set_reference_rdbfile,$(1),$(2))
72 endef
74 ifeq ($(OS),EMSCRIPTEN)
75 $(eval $(call gb_StaticLibrary_StaticLibrary,unoembind))
76 $(eval $(call gb_StaticLibrary_set_include,unoembind,\
77 $$(INCLUDE) \
79 $(eval $(call gb_StaticLibrary_use_api,unoembind,\
80 offapi \
81 udkapi \
83 $(eval $(call gb_StaticLibrary_add_exception_objects,unoembind,\
84 static/source/unoembindhelpers/PrimaryBindings\
87 endif
89 # vim: set noet sw=4 ts=4: