Colibre: tdf#146410 update Clone Formatting icons
[LibreOffice.git] / solenv / gbuild / StaticLibrary.mk
blob37fcf2b461308aa0aa07c48fdeea877fb1f3e25c
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/.
9 # This file incorporates work covered by the following license notice:
11 # Licensed to the Apache Software Foundation (ASF) under one or more
12 # contributor license agreements. See the NOTICE file distributed
13 # with this work for additional information regarding copyright
14 # ownership. The ASF licenses this file to you under the Apache
15 # License, Version 2.0 (the "License"); you may not use this file
16 # except in compliance with the License. You may obtain a copy of
17 # the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 # Static Library class
23 # defined globally in gbuild.mk
24 # defined by platform
25 # gb_StaticLibrary_get_filename
26 # gb_StaticLibrary_PLAINEXT
27 # gb_StaticLibrary_StaticLibrary_platform
30 # EVIL: gb_StaticLibrary and gb_Library need the same deliver rule because they are indistinguishable on windows
31 .PHONY : $(WORKDIR)/Clean/StaticLibrary/%
32 $(WORKDIR)/Clean/StaticLibrary/% :
33 $(call gb_Helper_abbreviate_dirs,\
34 rm -f $(AUXTARGETS))
36 define gb_StaticLibrary_StaticLibrary
37 $(call gb_StaticLibrary__StaticLibrary_impl,$(1),$(call gb_StaticLibrary_get_linktarget,$(1)))
39 endef
41 # call gb_StaticLibrary__StaticLibrary_impl,staticlib,linktarget
42 define gb_StaticLibrary__StaticLibrary_impl
43 $(call gb_LinkTarget_LinkTarget,$(2),StaticLibrary_$(1),NONE)
44 $(call gb_LinkTarget_set_targettype,$(2),StaticLibrary)
45 $(call gb_StaticLibrary_get_clean_target,$(1)) : $(call gb_LinkTarget_get_clean_target,$(2))
46 $(call gb_StaticLibrary_get_clean_target,$(1)) : AUXTARGETS :=
47 $(call gb_StaticLibrary_StaticLibrary_platform,$(1),$(2))
48 $$(eval $$(call gb_Module_register_target,$(call gb_StaticLibrary_get_target,$(1)),$(call gb_StaticLibrary_get_clean_target,$(1))))
49 $(call gb_Helper_make_userfriendly_targets,$(1),StaticLibrary)
51 endef
53 # this is a crude hack to "build" header files with include-what-you-use
54 define gb_StaticLibrary__add_iwyu_header
55 $(call gb_LinkTarget_get_target,$(call gb_StaticLibrary_get_linktarget,$(1))) : $(call gb_GenCxxObject_get_target,$(basename $(2)))
56 $(call gb_GenCxxObject_get_target,$(basename $(2))) : $(SRCDIR)/$(2)
57 $(call gb_GenCxxObject_get_target,$(basename $(2))) : WARNINGS_NOT_ERRORS := $(true)
58 $(call gb_GenCxxObject_get_target,$(basename $(2))) : GEN_CXX_SOURCE := $(SRCDIR)/$(2)
60 endef
61 define gb_StaticLibrary__add_iwyu_headers
62 $(foreach file,$(2),$(call gb_StaticLibrary__add_iwyu_header,$(1),$(file)))
63 endef
65 # forward the call to the gb_LinkTarget implementation
66 # (note: because the function name is in $(1), the other args are shifted by 1)
67 define gb_StaticLibrary__forward_to_Linktarget
68 $(call gb_LinkTarget_$(subst gb_StaticLibrary_,,$(1)),$(call gb_StaticLibrary_get_linktarget,$(2)),$(3),$(4),StaticLibrary_$(2))
70 endef
72 # copy pasta for forwarding: this could be (and was) done more elegantly, but
73 # these here can be found by both git grep and ctags
74 gb_StaticLibrary_add_cobject = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
75 gb_StaticLibrary_add_cobjects = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
76 gb_StaticLibrary_add_cxxobject = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
77 gb_StaticLibrary_add_cxxobjects = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
78 gb_StaticLibrary_add_objcxxobject = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
79 gb_StaticLibrary_add_objcxxobjects = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
80 gb_StaticLibrary_add_cxxclrobject = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
81 gb_StaticLibrary_add_cxxclrobjects = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
82 gb_StaticLibrary_add_asmobject = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
83 gb_StaticLibrary_add_asmobjects = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
84 gb_StaticLibrary_add_exception_objects = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
85 gb_StaticLibrary_add_x64_generated_exception_objects = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
86 gb_StaticLibrary_add_generated_cobjects = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
87 gb_StaticLibrary_add_x64_generated_cobjects = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
88 gb_StaticLibrary_add_generated_exception_objects = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
89 gb_StaticLibrary_add_generated_objcobjects = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
90 gb_StaticLibrary_add_generated_objcxxobjects = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
91 gb_StaticLibrary_add_generated_nasmobjects = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
92 gb_StaticLibrary_add_cflags = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
93 gb_StaticLibrary_add_cxxflags = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
94 gb_StaticLibrary_add_objcflags = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
95 gb_StaticLibrary_add_objcxxflags = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
96 gb_StaticLibrary_add_nasmflags = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
97 gb_StaticLibrary_add_cxxclrflags = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
98 gb_StaticLibrary_add_defs = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
99 gb_StaticLibrary_set_include = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
100 gb_StaticLibrary_add_ldflags = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
101 gb_StaticLibrary_set_ldflags = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
102 gb_StaticLibrary_set_x64 = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
103 gb_StaticLibrary_add_libs = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
104 gb_StaticLibrary_set_library_path_flags = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
105 gb_StaticLibrary_use_api = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
106 gb_StaticLibrary_use_sdk_api = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
107 gb_StaticLibrary_use_udk_api = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
108 gb_StaticLibrary_use_internal_api = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
109 gb_StaticLibrary_use_internal_bootstrap_api = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
110 gb_StaticLibrary_use_internal_comprehensive_api = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
111 gb_StaticLibrary_use_external = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
112 gb_StaticLibrary_use_externals = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
113 gb_StaticLibrary_use_custom_headers = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
114 gb_StaticLibrary_use_package = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
115 gb_StaticLibrary_use_packages = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
116 gb_StaticLibrary_use_unpacked = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
117 gb_StaticLibrary_use_external_project = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
118 gb_StaticLibrary_use_static_libraries = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
119 gb_StaticLibrary_add_sdi_headers = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
120 gb_StaticLibrary_set_precompiled_header = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
121 gb_StaticLibrary_reuse_precompiled_header = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
122 gb_StaticLibrary_use_common_precompiled_header = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
123 gb_StaticLibrary_set_warnings_not_errors = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
124 gb_StaticLibrary_set_warnings_disabled = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
125 gb_StaticLibrary_set_external_code = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
126 gb_StaticLibrary_set_generated_cxx_suffix = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
127 gb_StaticLibrary_use_clang = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
128 gb_StaticLibrary_set_clang_precompiled_header = $(call gb_StaticLibrary__forward_to_Linktarget,$(0),$(1),$(2),$(3))
130 # vim: set noet sw=4: