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 # CliNativeLibraryTarget class
12 gb_CliNativeLibraryTarget_EXT
:= $(gb_CliAssembly_POLICYEXT
)
14 gb_CliNativeLibraryTarget__get_library
= $(call gb_CliAssembly_get_dll
,$(1))
16 define gb_CliNativeLibraryTarget__command
17 $(call gb_Output_announce
,$(1),$(true
),SN
,4)
18 $(call gb_Helper_abbreviate_dirs
,\
19 $(GNUCOPY
) $(CLI_NATIVE_LIBRARY
) $(1).tmp
&& \
20 sn
-R
$(1).tmp
$(CLI_NATIVE_KEYFILE
) && \
25 $(dir $(call gb_CliNativeLibraryTarget_get_target
,%)).
dir :
26 $(if
$(wildcard $(dir $@
)),,mkdir
-p
$(dir $@
))
28 $(dir $(call gb_CliNativeLibraryTarget_get_target
,%))%/.
dir :
29 $(if
$(wildcard $(dir $@
)),,mkdir
-p
$(dir $@
))
31 $(call gb_CliNativeLibraryTarget_get_target
,%) :
32 $(call gb_CliNativeLibraryTarget__command
,$@
,$*,$<)
34 $(call gb_CliNativeLibraryTarget_get_external_target
,%) :
37 .PHONY
: $(call gb_CliNativeLibraryTarget_get_clean_target
,%)
38 $(call gb_CliNativeLibraryTarget_get_clean_target
,%) :
39 $(call gb_Output_announce
,$*,$(false
),SN
,4)
40 $(call gb_Helper_abbreviate_dirs
,\
41 rm -rf
$(call gb_CliNativeLibraryTarget_get_target
,$*) \
42 $(call gb_CliNativeLibraryTarget_get_external_target
,$*) \
45 define gb_CliNativeLibraryTarget_CliNativeLibraryTarget
46 $(call gb_CliNativeLibraryTarget_get_target
,$(1)) : CLI_NATIVE_ASSEMBLIES
:= $(gb_Helper_MISCDUMMY
)
47 $(call gb_CliNativeLibraryTarget_get_target
,$(1)) : CLI_NATIVE_KEYFILE
:=
48 $(call gb_CliNativeLibraryTarget_get_target
,$(1)) : CLI_NATIVE_LIBRARY
:=
50 $(call gb_CliNativeLibraryTarget_get_external_target
,$(1)) :|
$(dir $(call gb_CliNativeLibraryTarget_get_target
,$(1))).
dir
51 $(call gb_CliNativeLibraryTarget_get_target
,$(1)) :|
$(dir $(call gb_CliNativeLibraryTarget_get_target
,$(1))).
dir
55 define gb_CliNativeLibraryTarget_wrap_library
56 $(call gb_CliNativeLibraryTarget_get_target
,$(1)) : CLI_NATIVE_LIBRARY
:= $(call gb_CliNativeLibraryTarget__get_library
,$(2))
57 $(call gb_CliNativeLibraryTarget_get_target
,$(1)) : $(call gb_Library_get_target
,$(2))
58 $(call gb_Library_get_external_headers_target
,$(2)) : $(call gb_CliNativeLibraryTarget_get_external_target
,$(1))
62 define gb_CliNativeLibraryTarget_set_keyfile
63 $(call gb_CliNativeLibraryTarget_get_target
,$(1)) : CLI_NATIVE_KEYFILE
:= $(2)
64 $(call gb_CliNativeLibraryTarget_get_target
,$(1)) : $(2)
68 define gb_CliNativeLibraryTarget_use_assembly
69 $(call gb_CliNativeLibraryTarget_get_target
,$(1)) : CLI_NATIVE_ASSEMBLIES
+= $(call gb_CliLibrary_get_target
,$(2))
70 $(call gb_CliNativeLibraryTarget_get_external_target
,$(1)) : $(call gb_CliLibrary_get_target
,$(2))
74 define gb_CliNativeLibraryTarget_use_assemblies
75 $(foreach assembly
,$(2),$(call gb_CliNativeLibraryTarget_use_assembly
,$(1),$(assembly
)))
79 # CliNativeLibrary class
81 gb_CliNativeLibrary_PLATFORM_DEFAULT
:= x86
82 gb_CliNativeLibrary_EXT
:= $(gb_CliNativeLibraryTarget_EXT
)
84 # Create a CLI library for a native library
86 # CliNativeLibrary target
87 define gb_CliNativeLibrary_CliNativeLibrary
88 $(call gb_CliNativeLibraryTarget_CliNativeLibraryTarget
,$(1))
89 $(call gb_CliAssembly_CliAssembly
,$(1))
91 $(call gb_CliNativeLibraryTarget_set_keyfile
,$(1),$(gb_CliAssembly_KEYFILE_DEFAULT
))
92 $(call gb_CliAssembly_set_platform
,$(1),$(gb_CliNativeLibrary_PLATFORM_DEFAULT
))
94 $(call gb_CliNativeLibrary_get_target
,$(1)) : $(call gb_CliNativeLibraryTarget_get_target
,$(1))
95 $(call gb_CliNativeLibrary_get_target
,$(1)) :|
$(call gb_CliAssembly_get_target
,$(1))
96 $(call gb_CliNativeLibrary_get_target
,$(1)) :|
$(dir $(call gb_CliNativeLibrary_get_target
,$(1))).
dir
97 $(call gb_CliNativeLibrary_get_clean_target
,$(1)) : $(call gb_CliNativeLibraryTarget_get_clean_target
,$(1))
98 $(call gb_CliNativeLibrary_get_clean_target
,$(1)) : $(call gb_CliAssembly_get_clean_target
,$(1))
100 $(call gb_Deliver_add_deliverable
,$(call gb_CliNativeLibrary_get_target
,$(1)),$(call gb_CliNativeLibraryTarget_get_target
,$(1)),$(1))
102 $$(eval
$$(call gb_Module_register_target
,$(call gb_CliNativeLibrary_get_target
,$(1)),$(call gb_CliNativeLibrary_get_clean_target
,$(1))))
103 $(call gb_Helper_make_userfriendly_targets
,$(1),CliNativeLibrary
)
107 define gb_CliNativeLibrary_set_configfile
108 $(call gb_CliAssembly_set_configfile
,$(1),$(2))
112 define gb_CliNativeLibrary_set_keyfile
113 $(call gb_CliNativeLibraryTarget_set_keyfile
,$(1),$(2))
114 $(call gb_CliAssembly_set_keyfile
,$(1),$(2))
118 define gb_CliNativeLibrary_set_platform
119 $(call gb_CliAssembly_set_platform
,$(1),$(2))
123 define gb_CliNativeLibrary_set_policy
124 $(call gb_CliAssembly_set_policy
,$(1),$(2),$(3))
128 define gb_CliNativeLibrary_wrap_library
129 $(call gb_CliNativeLibraryTarget_wrap_library
,$(1),$(2))
133 define gb_CliNativeLibrary_use_assembly
134 $(call gb_CliNativeLibraryTarget_use_assembly
,$(1),$(2))
138 define gb_CliNativeLibrary_use_assemblies
139 $(call gb_CliNativeLibraryTarget_use_assemblies
,$(1),$(2))
143 # vim: set noet sw=4 ts=4: