Branch libreoffice-5-0-4
[LibreOffice.git] / solenv / gbuild / CliNativeLibrary.mk
blobbe2862151a02de6dbfa21c42ffbb89d122ac70c0
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 # CliNativeLibrary class
12 gb_CliNativeLibrary_PLATFORM_DEFAULT := x86
13 gb_CliNativeLibrary_EXT := $(gb_CliAssembly_POLICYEXT)
15 gb_CliNativeLibrary__get_library = $(call gb_CliAssembly_get_dll,$(1))
17 define gb_CliNativeLibrary__command
18 $(call gb_Output_announce,$(2),$(true),SN ,4)
19 $(call gb_Helper_abbreviate_dirs,\
20 $(GNUCOPY) $(CLI_NATIVE_LIBRARY) $(1).tmp && \
21 sn -R $(1).tmp $(CLI_NATIVE_KEYFILE) && \
22 mv $(1).tmp $(1) \
24 endef
26 $(call gb_CliNativeLibrary_get_preparation_target,%) :
27 mkdir -p $(dir $@) && touch $@
29 .PHONY : $(call gb_CliNativeLibrary_get_clean_target,%)
30 $(call gb_CliNativeLibrary_get_clean_target,%) :
31 $(call gb_Output_announce,$*,$(false),SN ,4)
32 $(call gb_Helper_abbreviate_dirs,\
33 rm -rf $(call gb_CliNativeLibrary_get_target,$*) \
34 $(call gb_CliNativeLibrary_get_preparation_target,$*) \
38 # Create a CLI library for a native library
40 # CliNativeLibrary target
41 define gb_CliNativeLibrary_CliNativeLibrary
42 $(call gb_CliAssembly_CliAssembly,$(1),$(call gb_CliNativeLibrary_get_target,$(1)))
44 $(call gb_CliNativeLibrary_get_target,$(1)) : CLI_NATIVE_ASSEMBLIES := $(gb_Helper_MISCDUMMY)
45 $(call gb_CliNativeLibrary_get_target,$(1)) : CLI_NATIVE_KEYFILE :=
46 $(call gb_CliNativeLibrary_get_target,$(1)) : CLI_NATIVE_LIBRARY :=
49 $(call gb_CliNativeLibrary_set_keyfile,$(1),$(gb_CliAssembly_KEYFILE_DEFAULT))
50 $(call gb_CliAssembly_set_platform,$(1),$(gb_CliNativeLibrary_PLATFORM_DEFAULT))
52 $(call gb_CliNativeLibrary_get_target,$(1)) :| $(call gb_CliAssembly_get_target,$(1))
53 $(call gb_CliNativeLibrary_get_target,$(1)) :| $(dir $(call gb_CliNativeLibrary_get_target,$(1))).dir
54 $(call gb_CliNativeLibrary_get_clean_target,$(1)) : $(call gb_CliAssembly_get_clean_target,$(1))
56 $$(eval $$(call gb_Module_register_target,$(call gb_CliNativeLibrary_get_target,$(1)),$(call gb_CliNativeLibrary_get_clean_target,$(1))))
57 $(call gb_Helper_make_userfriendly_targets,$(1),CliNativeLibrary)
59 $(call gb_CliNativeLibrary_get_target,$(1)) :
60 $$(call gb_CliNativeLibrary__command,$$@,$(1))
63 endef
65 define gb_CliNativeLibrary_set_configfile
66 $(call gb_CliAssembly_set_configfile,$(1),$(2))
68 endef
70 define gb_CliNativeLibrary_set_keyfile
71 $(call gb_CliAssembly_set_keyfile,$(1),$(2))
72 $(call gb_CliNativeLibrary_get_target,$(1)) : CLI_NATIVE_KEYFILE := $(2)
73 $(call gb_CliNativeLibrary_get_target,$(1)) : $(2)
75 endef
77 define gb_CliNativeLibrary_set_platform
78 $(call gb_CliAssembly_set_platform,$(1),$(2))
80 endef
82 define gb_CliNativeLibrary_set_policy
83 $(call gb_CliAssembly_set_policy,$(1),$(2),$(3))
85 endef
87 define gb_CliNativeLibrary_wrap_library
88 $(call gb_CliNativeLibrary_get_target,$(1)) : \
89 CLI_NATIVE_LIBRARY := $(call gb_CliNativeLibrary__get_library,$(2))
90 $(call gb_CliNativeLibrary_get_target,$(1)) : \
91 $(call gb_Library_get_target,$(2))
92 $(call gb_Library_get_headers_target,$(2)) : \
93 $(call gb_CliNativeLibrary_get_preparation_target,$(1))
95 endef
97 define gb_CliNativeLibrary_use_assembly
98 $(call gb_CliNativeLibrary_get_target,$(1)) : \
99 CLI_NATIVE_ASSEMBLIES += $(call gb_CliLibrary_get_target,$(2))
100 $(call gb_CliNativeLibrary_get_preparation_target,$(1)) : \
101 $(call gb_CliLibrary_get_target,$(2))
103 endef
105 define gb_CliNativeLibrary_use_assemblies
106 $(foreach assembly,$(2),$(call gb_CliNativeLibrary_use_assembly,$(1),$(assembly)))
108 endef
110 # vim: set noet sw=4 ts=4: