1 # -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
2 # Version: MPL 1.1 / GPLv3+ / LGPLv3+
4 # The contents of this file are subject to the Mozilla Public License Version
5 # 1.1 (the "License"); you may not use this file except in compliance with
6 # the License or as specified alternatively below. You may obtain a copy of
7 # the License at http://www.mozilla.org/MPL/
9 # Software distributed under the License is distributed on an "AS IS" basis,
10 # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11 # for the specific language governing rights and limitations under the
14 # Major Contributor(s):
15 # Copyright (C) 2012 Red Hat, Inc., David Tardon <dtardon@redhat.com>
18 # All Rights Reserved.
20 # For minor contributions see the git repository.
22 # Alternatively, the contents of this file may be used under the terms of
23 # either the GNU General Public License Version 3 or later (the "GPLv3+"), or
24 # the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
25 # in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
26 # instead of those above.
28 .PHONY
: $(call gb_UnoApi_get_clean_target
,%)
29 $(call gb_UnoApi_get_clean_target
,%) :
30 $(call gb_Helper_abbreviate_dirs
,\
31 rm -f
$(call gb_UnoApi_get_target
,$*))
33 define gb_UnoApi_UnoApi
34 $(call gb_UnoApiTarget_UnoApiTarget
,$(1))
35 $(call gb_UnoApiHeadersTarget_UnoApiHeadersTarget
,$(1))
36 $(call gb_Package_Package_internal
,$(1)_idl
,$(SRCDIR
))
37 $(call gb_Package_Package_internal
,$(1)_inc
,$(call gb_UnoApiHeadersTarget_get_dir
,$(1)))
39 $(call gb_UnoApiTarget_set_root
,$(1),UCR
)
41 $(call gb_UnoApi_get_target
,$(1)) :|
$(dir $(call gb_UnoApi_get_target
,$(1))).
dir
42 $(call gb_UnoApi_get_target
,$(1)) : $(call gb_UnoApiTarget_get_target
,$(1))
43 $(call gb_UnoApi_get_target
,$(1)) :|
$(call gb_Package_get_target
,$(1)_idl
)
44 $(call gb_UnoApi_get_target
,$(1)) :|
$(call gb_Package_get_target
,$(1)_inc
)
45 $(call gb_UnoApi_get_clean_target
,$(1)) : $(call gb_UnoApiTarget_get_clean_target
,$(1))
46 $(call gb_UnoApi_get_clean_target
,$(1)) : $(call gb_UnoApiHeadersTarget_get_clean_target
,$(1))
47 $(call gb_UnoApi_get_clean_target
,$(1)) : $(call gb_Package_get_clean_target
,$(1)_idl
)
48 $(call gb_UnoApi_get_clean_target
,$(1)) : $(call gb_Package_get_clean_target
,$(1)_inc
)
50 $(call gb_UnoApiTarget_get_headers_target
,$(1)) : $(call gb_Package_get_target
,$(1)_idl
)
51 $(call gb_Package_get_preparation_target
,$(1)_inc
) : $(call gb_UnoApiHeadersTarget_get_target
,$(1))
53 $(call gb_Deliver_add_deliverable
,$(call gb_UnoApi_get_target
,$(1)),$(call gb_UnoApiTarget_get_target
,$(1)),$(1))
55 $$(eval
$$(call gb_Module_register_target
,$(call gb_UnoApi_get_target
,$(1)),$(call gb_UnoApi_get_clean_target
,$(1))))
59 define gb_UnoApi__add_idlfile
60 $(call gb_Package_add_file
,$(1)_idl
,$(patsubst $(1)/%,idl
/%,$(2)),$(2))
64 define gb_UnoApi__add_headerfile_impl
65 $(call gb_Package_add_file
,$(1)_inc
,inc
/$(2),$(3))
66 $(call gb_UnoApiHeadersTarget_add_headerfile
,$(1),$(2),$(3))
70 # Note: the expression in 3rd arg of call of gb_UnoApi__add_headerfile_impl
71 # removes the leftmost dir in the subpath .-)
72 define gb_UnoApi__add_headerfile
73 $(call gb_UnoApi__add_headerfile_impl
,$(1),$(2),$(subst $() $(),/,$(wordlist
2,$(words $(subst /, ,$(2))),$(subst /, ,$(2)))))
77 define gb_UnoApi__add_idlfile_noheader
78 $(call gb_UnoApi__add_idlfile
,$(1),$(2).idl
)
82 define gb_UnoApi__add_idlfile_nohdl
83 $(call gb_UnoApi__add_idlfile_noheader
,$(1),$(2))
84 $(call gb_UnoApi__add_headerfile
,$(1),$(2).hpp
)
88 define gb_UnoApi__add_idlfile_full
89 $(call gb_UnoApi__add_idlfile_nohdl
,$(1),$(2))
90 $(call gb_UnoApi__add_headerfile
,$(1),$(2).hdl
)
94 # for interfaces, exceptions, structs, enums, constant groups
95 define gb_UnoApi_add_idlfile
96 $(call gb_UnoApiTarget_add_idlfile
,$(1),$(2),$(3))
97 $(call gb_UnoApi__add_idlfile_full
,$(1),$(2)/$(3))
101 define gb_UnoApi_add_idlfiles
102 $(call gb_UnoApiTarget_add_idlfiles
,$(1),$(2),$(3))
103 $(foreach idl
,$(3),$(call gb_UnoApi__add_idlfile_full
,$(1),$(2)/$(idl
)))
107 # for new-style services
108 define gb_UnoApi_add_idlfile_nohdl
109 $(call gb_UnoApiTarget_add_idlfile
,$(1),$(2),$(3))
110 $(call gb_UnoApi__add_idlfile_nohdl
,$(1),$(2)/$(3))
114 define gb_UnoApi_add_idlfiles_nohdl
115 $(call gb_UnoApiTarget_add_idlfiles
,$(1),$(2),$(3))
116 $(foreach idl
,$(3),$(call gb_UnoApi__add_idlfile_nohdl
,$(1),$(2)/$(idl
)))
120 # for old-style services and modules
121 define gb_UnoApi_add_idlfile_noheader
122 $(call gb_UnoApiTarget_add_idlfile
,$(1),$(2),$(3))
123 $(call gb_UnoApi__add_idlfile_noheader
,$(1),$(2)/$(3))
127 define gb_UnoApi_add_idlfiles_noheader
128 $(call gb_UnoApiTarget_add_idlfiles
,$(1),$(2),$(3))
129 $(foreach idl
,$(3),$(call gb_UnoApi__add_idlfile_noheader
,$(1),$(2)/$(idl
)))
133 define gb_UnoApi__use_api
134 $(call gb_UnoApiHeadersTarget_use_api
,$(1),$(2))
135 $(call gb_UnoApi_get_target
,$(1)) :|
$(call gb_UnoApi_get_target
,$(2))
136 $(call gb_UnoApiTarget_get_external_headers_target
,$(1)) : $(call gb_UnoApiTarget_get_headers_target
,$(2))
140 define gb_UnoApi_add_api
141 $$(call gb_Output_error
,gb_UnoApi_add_api
: use gb_UnoApi_use_api instead.
)
144 define gb_UnoApi_use_api
145 $(foreach rdb
,$(2),$(call gb_UnoApi__use_api
,$(1),$(rdb
)))
149 define gb_UnoApi_add_reference_rdbfile
150 $$(call gb_Output_error
,gb_UnoApi_add_reference_rdbfile
: use gb_UnoApi_set_reference_rdbfile instead.
)
154 define gb_UnoApi_set_reference_rdbfile
155 $(call gb_UnoApiTarget_set_reference_rdbfile
,$(1),$(2))
159 define gb_UnoApi_set_include
160 $(call gb_UnoApiTarget_set_include
,$(1),$(2))
164 # vim: set noet sw=4 ts=4: